title: Ansible breadcrumbs:
--ask-pass
--ask-become-pass
--username=<username>
--private-key=<key>
(use /dev/null
to explicitly avoid SSH keys)ansible {all|<target>} -i <inventory> [-m <module>] [-a <module-arg>]
all -i <host>,
(with the comma).all -i localhost, --connection=local
.... -m ping
... -a <cmd>
... -a 'bash -c "nvidia-smi > /dev/null"'
ansible <...> -m setup -a 'filter=ansible_os_*'
(example fact filter)ansible-playbook <playbook>
ansible-playbook -i <hosts> <playbook>
ansible-playbook -l <group|host> <playbook>
ansible-playbook -t <tag> <playbook>
ansible-playbook --vault-password-file <file> <...>
ansible-vault encrypt_string --vault-password-file ~/.ansible_vault/stuff
no_log
in tasks handling secrets.Example /etc/ansible/ansible.cfg
or ~/.ansible.cfg
:
[defaults]
# Change to "auto" if this path causes problems
interpreter_python = /usr/bin/python3
host_key_checking = false
#jinja2: trim_blocks:False
to avoid that. This will also make the output a little uglier with empty lines in place of unsatisfied conditionals and stuff though.Probably caused by a password-protected SSH key. Add --private-key=<keyfile>
to specify which SSH key to use or --private-key=/dev/null
to avoid using any SSH key.
{% include footer.md %}