I have an Ansible playbook that runs against a Linux target host and uses become to gain elevated permissions for those actions that require it.

For auditing purposes, I need a list of all the Unix commands that are executed using those elevated rights.

I.e., suppose the playbook uses the yum module to install a package:

- name: Example
  become: yes
    - name: Provide current Apache
        name: httpd
        state: latest

I need to see that the /usr/bin/dnf binary is called with root permissions.

How can I configure the various logging systems involved to provide that information?


1 Answer 1


Maybe setting verbosity level inside Ansible could provide that information. You could either pass it as an argument '-vv or -v' or setting it in the ansible.cfg => verbosity = 2

  • While this answer is factually correct, I would love to see more context provided as for example done in this related answer.
    – YoshiMbele
    Commented Jul 17, 2023 at 8:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.