-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yaml
21 lines (20 loc) · 1.12 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
- hosts: all
become: yes
roles:
# - { role: snapcreate, when: ( ansible_distribution == "Ubuntu" ) or
# ( ansible_distribution == "Debian" ) or
# ( ansible_distribution == "CentOS" ) or
# ( ansible_distribution == "Amazon" ) or
# ( ansible_distribution == "RedHat" ) }
- { role: apt_update, when: ( inventory_hostname != "localhost") and ( ansible_distribution == "Ubuntu" ) or
( ansible_distribution == "Debian" ) }
- { role: yum_update, when: ( inventory_hostname != "localhost") and ( ansible_distribution == "CentOS" ) or
( ansible_distribution == "Amazon" ) or
( ansible_distribution == "RedHat" ) }
#- { role: logoff, when: ( 'localhost' in inventory_hostname ) }
vars:
reboot_ok: true
#ansible_hostname != "testicle"
# How to run
# ansible-playbook -b -u <user> --private-key <path to key> -i hosts -l <host-group> main.yml [--extra-vars reboot_ok=true]