Ansible - Ad-hoc command

1 - About

Ad Hoc are command executed as in the shell.

This is because the default module of the ansible command line is command

3 - Example


[dev]
ansibleHostName1  ansible_host=hostname1  ansible_ssh_private_key_file=./privateKey.pem ansible_user=user
ansibleHostName2  ansible_host=hostname2  ansible_ssh_private_key_file=./privateKey.pem ansible_user=user

  • Example:

ansible -i ansible/hosts-remote.ini --playbook-dir=ansible -a "echo nico" dev 


ansibleHostName1 | CHANGED | rc=0 >>
nico

ansibleHostName2 | CHANGED | rc=0 >>
nico


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap