Added a playbook example
This commit is contained in:
parent
389920b544
commit
746c08aa6b
|
@ -0,0 +1 @@
|
|||
playbook.retry
|
|
@ -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
|
Reference in New Issue