| Zeile 61: |
Zeile 61: |
| | | | |
| | ansible all -m ping | | ansible all -m ping |
| | + | |
| | + | === Ausführen eines Shell-Kommandos === |
| | + | |
| | + | Mit Ansible lässt sich auch jedes beliebige [[Shell]]-Kommando ausführen: |
| | + | |
| | + | ansible zielrechner -m command -a "whoami" |
| | + | |
| | + | Will man das Kommando als root ausführen, setzt man <code>--become</code> hinzu: |
| | + | ansible pia2016 --become -m command -a "whoami" |
| | | | |
| | == Weiterführendes == | | == Weiterführendes == |