User Tools

Site Tools


ansible:ansible_cmd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ansible:ansible_cmd [2023/03/06 00:26]
manu
ansible:ansible_cmd [2024/04/19 12:26] (current)
manu [All ansible commands]
Line 1: Line 1:
 ====== Ansible command examples ====== ====== Ansible command examples ======
 +
 +===== All ansible commands =====
 +
 +https://​docs.ansible.com/​ansible/​latest/​command_guide/​command_line_tools.html
 +
 +**ansible-rulebook** : start a playbook based on a specific event
 +  https://​blog.stephane-robert.info/​post/​ansible-event-driven/​
 +
 +**ansible-pull** : opposite to ansible is based on the push mode, offering a central management, the pull mode can be use in specific cases
 +  https://​blog.octo.com/​ansible-pull-killer-feature
 +  ​
 +**ansible-galaxy** : get collections of playbooks
 +
 +**ansible** : Define and run a single task ‘playbook’ against a set of hosts
 +
 +**ansible-playbook** : Define and run a single task ‘playbook’ against a set of hosts
 +
 +**ansible-config** : View ansible configuration
 + 
 +**ansible-console** : REPL console for executing Ansible tasks
 +
 +**ansible-doc** : plugin documentation tool
 +
 +**ansible-galaxy** : Perform various Role and Collection related operations
 +
 +**ansible-inventory** : Show Ansible inventory information,​ by default it uses the inventory script JSON format
 +
 +**ansible-vault** : encryption/​decryption utility for Ansible data files
 +
 +**ansible-lint** : check playbook syntax ​
  
 ===== cmd ===== ===== cmd =====
Line 49: Line 79:
 aix20 | SUCCESS => {"​changed":​ false,"​ping":​ "​pong"​} aix20 | SUCCESS => {"​changed":​ false,"​ping":​ "​pong"​}
 </​cli>​ </​cli>​
 +
 +<cli prompt='​$'>​
 +$ ANSIBLE_REMOTE_USER=user01 ansible all -k -K -m ping
 +SSH password:
 +BECOME password[defaults to SSH password]:
 +         ​172.16.120.155 | FAILED! => {
 +    "​msg":​ "Using a SSH password instead of a key is not
 +    possible because Host Key checking is enabled and sshpass
 +    does not support this.  Please add this host's fingerprint
 +    to your known_hosts file to manage this host."
 +    }
 +         ​172.16.120.122 | FAILED! => {
 +    "​msg":​ "Using a SSH password instead of a key is not
 +    possible because Host Key checking is enabled and sshpass
 +    does not support this.  Please add this host's fingerprint
 +    to your known_hosts file to manage this host."
 +}
 +         ​172.16.120.123 | SUCCESS => {
 +    "​ansible_facts":​ {
 +        "​discovered_interpreter_python":​ "/​usr/​libexec/​
 +        platform-python"​
 +    },
 +    "​changed":​ false,
 +    "​ping":​ "​pong"​
 +}
 +</​cli>​
 +
 +
  
 File conversion: File conversion:
Line 366: Line 424:
     when: results.changed == true     when: results.changed == true
 </​cli>​ </​cli>​
 +
 +
ansible/ansible_cmd.1678058761.txt.gz · Last modified: 2023/03/06 00:26 by manu