This repository has been archived on 2022-11-09. You can view files and clone it, but cannot push or open issues or pull requests.
Ansible-Proxmox-inventory/playbook-example/playbook.yml

22 lines
500 B
YAML

---
# 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