Ansible Install: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 15: | Zeile 15: | ||
private_key_file = ~/.ssh/id_rsa | private_key_file = ~/.ssh/id_rsa | ||
roles_path = $HOME/ansible/roles | roles_path = $HOME/ansible/roles | ||
| + | =Inventory= | ||
| + | *cat inventory | ||
| + | [cloud] | ||
| + | 10.0.10.99 | ||
| + | =Ansible ping= | ||
| + | *ansible all -m ping | ||
| + | <pre> | ||
| + | 10.0.10.99 | SUCCESS => { | ||
| + | "ansible_facts": { | ||
| + | "discovered_interpreter_python": "/usr/bin/python3" | ||
| + | }, | ||
| + | "changed": false, | ||
| + | "ping": "pong" | ||
| + | } | ||
| + | </pre> | ||
Version vom 12. September 2024, 05:36 Uhr
Installation
Allgemein
- apt install python-pip
- python -m pip install ansible
Windowsunterstützung
- pip3 install pywinrm
Arbeitsverzeichnis
- mkdir ~/ansible
- cd ~/ansible
Ansible-Konfigurationsdatei
- cat ansible.cfg
[defaults] inventory = inventory private_key_file = ~/.ssh/id_rsa roles_path = $HOME/ansible/roles
Inventory
- cat inventory
[cloud] 10.0.10.99
Ansible ping
- ansible all -m ping
10.0.10.99 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python3"
},
"changed": false,
"ping": "pong"
}