Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save frankmanzhu/78f0d2912f3ddf73dc19fd1d48bf251c to your computer and use it in GitHub Desktop.

Select an option

Save frankmanzhu/78f0d2912f3ddf73dc19fd1d48bf251c to your computer and use it in GitHub Desktop.
Ansible Missing sudo password
Ansible file
- name: config /etc/hosts for the cluster
become: true
blockinfile:
block: "{{ lookup('file', '/home/hosts') }}"
dest: "/etc/hosts"
marker: "# {mark} ANSIBLE MANAGED BLOCK "
backup: yes
I was able to overcome this by adding this to our ansible.cfg file:
[defaults]
sudo_flags=-H -S
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment