Added a playbook example

This commit is contained in:
xezpeleta 2016-11-23 09:55:00 +01:00
parent 389920b544
commit 746c08aa6b
2 changed files with 22 additions and 0 deletions

1
playbook-example/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
playbook.retry

View File

@ -0,0 +1,21 @@
---
# Example:
# ansible-playbook -i /etc/ansible/proxmox.py --limit 'running' playbook.yml
- hosts: all
remote_user: root
tasks:
- name: get hostname
command: /bin/hostname
changed_when: False
register: hostname
- name: get uptime
shell: /usr/bin/uptime | grep -ohe 'up .*' | sed 's/,//g' | awk '{ print $2" "$3 }'
changed_when: False
register: uptime
- debug: var={{ item }}
with_items:
- hostname.stdout
- uptime.stdout