-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplatform.yml
110 lines (84 loc) · 3.98 KB
/
platform.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
- name: "Check Platform "
hosts: all
# connection: paramiko
# vars:
# ansible_ssh_user: "{{ usrR }}"
# ansible_ssh_pass: "{{ passR }}"
# ansible_paramiko_user: "{{ usrR }}"
# ansible_paramiko_pass: "{{ passR }}"
# ansible_ssh_private_key_file: /path/to/private_key
# ansible_ssh_pass: passphrase_for_private_key
tasks:
############# CentOS #####################
- command: echo "CentOS or RHEL"
- debug:
msg: "CentOS or RHEL"
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == "6" or ansible_distribution == 'Red Hat Enterprise Linux'
- command: echo "CentOS or RHEL"
- debug:
msg: "CentOS or RHEL"
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == "7" or ansible_distribution == 'Red Hat Enterprise Linux'
############# Ubuntu ######################
- command: echo "Ubuntu"
- debug:
msg: "Ubuntu {{ ansible_distribution_version }}"
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'precise' and ansible_distribution_version == '12.04'
- command: echo "Ubuntu"
- debug:
msg: "Ubuntu {{ ansible_distribution_version }}"
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty' and ansible_distribution_version == '14.04'
- command: echo "Ubuntu"
- debug:
msg: "Ubuntu {{ ansible_distribution_version }}"
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'xenial' and ansible_distribution_version == '16.04'
- command: echo "Ubuntu"
- debug:
msg: "Ubuntu {{ ansible_distribution_version }}"
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'zesty' and ansible_distribution_version == '17.04'
####### Debian ############################
- command: echo "Debian "
- debug:
msg: "Debian {{ ansible_distribution_version }} "
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'stretch' and ansible_distribution_major_version == '9'
- command: echo "Debian "
- debug:
msg: "Debian {{ ansible_distribution_version }} "
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' and ansible_distribution_major_version == '8'
- command: echo "Debian "
- debug:
msg: "Debian {{ ansible_distribution_version }} "
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'wheezy' and ansible_distribution_major_version == '7'
########### SUSE #########################
- command: echo "openSUSE Leap"
- debug:
msg: "openSUSE Leap {{ ansible_distribution_version }} "
when: ansible_distribution == 'openSUSE Leap' and ansible_distribution_version == "42.2"
### Important!!! #################
## Fri 23 Feb 2018 06:33:08 PM +04
##
## when: (ansible_distribution == "CentOS" and ansible_distribution_major_version == "6") or
## (ansible_distribution == "Debian" and ansible_distribution_major_version == "7")
## ansible-playbook -i 176.32.195.91, --extra-vars 'usrR=root passR=PmbNVj3Rkuhb' platform.yml
#- set_fact:
# destination: "/etc/nagios/nrpe.d/"
# when: ansible_os_family == "Debian"
#- set_fact:
# destination: "/etc/nrpe.d/"
# when: ansible_os_family == "RedHat"
# "ansible_distribution": "CentOS",
# "ansible_distribution_release": "Final",
# "ansible_distribution_version": "5.9"
# "ansible_distribution": "CentOS",
# "ansible_distribution_release": "Final",
# "ansible_distribution_version": "6.4"
# "ansible_distribution": "Ubuntu",
# "ansible_distribution_release": "lucid",
# "ansible_distribution_version": "10.04"
# "ansible_distribution": "Ubuntu",
# "ansible_distribution_release": "precise",
# "ansible_distribution_version": "12.04"
# "ansible_distribution": "Debian",
# "ansible_distribution_release": "wheezy",
# "ansible_distribution_version": "7"
##########################################