user9733940
user9733940

Reputation:

Ansible privilege escalation become with sudo -i

I can become root on host only with command "sudo -i". I must be root to make some changes on this host. How can I become root with this method using ansibleplaybook?

Upvotes: 0

Views: 876

Answers (1)

Simon
Simon

Reputation: 4475

For privilege escalation, become allows you to specify both become_method and become_flags:

- name: My playbook
  hosts: myhosts
  become: yes
  become_method: sudo
  become_flags: '-i'
  tasks:

  - name: My task
    [..]

Upvotes: 1

Related Questions