main.yml 4.18 KB
Newer Older
1
2
3
---

- name: Install Nagios
4
  yum: name=nagios state=latest enablerepo=nagios
5

6
7
8
9
10
11
12
13
14
15
16
17
18
- name: Install pnp4nagios
  yum: name=pnp4nagios state=latest

- name: Install Apache and mod_ssl
  yum: name={{ item }} state=latest
  with_items:
    - httpd
    - mod_ssl

- name: Install fetch-crl
  yum: name=fetch-crl state=latest
  when: ca_bundle_install

19
20
- name: Install NCG and MSG conponents
  yum: name={{ item.name }} state=latest enablerepo={{ item.repo }}
21
22
  with_items: nagios_components

23
24
25
26
- name: Install Nagios plugins
  yum: name={{ item.name }} state=latest enablerepo={{ item.repo }}
  with_items: nagios_plugins
  
27
- name: Install Nagios UMD plugins
28
  yum: name={{ item }} state=latest
29
30
31
  with_items: nagios_plugins_umd
  when: nagios_plugins_umd is defined

32
33
34
35
- name: Copy nagios.cfg file
  template: src=nagios.cfg.j2
            dest=/etc/nagios/nagios.cfg
            owner=nagios group=nagios mode=0644
36
37
38
39
40
41
42
  notify: reload nagios

- name: Copy cgi.cfg file
  template: src=cgi.cfg.j2
            dest=/etc/nagios/cgi.cfg
            owner=nagios group=nagios mode=0644
  notify: reload nagios
43

44
45
#FIXME: Make this tenant unaware
- name: Copy ncg.conf file for EGI
46
  template: src=ncg.conf.j2
47
48
49
50
51
52
53
            dest=/etc/argo-ncg/ncg.conf
            owner=root group=root
  when: tenant_name == "EGI"
  notify: reload nagios

- name: Copy ncg.conf file for EUDAT
  template: src=ncg.conf.eudat.j2
54
55
            dest=/etc/ncg/ncg.conf
            owner=root group=root
56
57
  when: tenant_name == "EUDAT"
  notify: reload nagios
58

59
60
61
62
63
64
65
- name: Copy argo-voms-htpasswd.conf file
  template: src=argo-voms-htpasswd.conf.j2
            dest=/etc/argo-voms-htpasswd/argo-voms-htpasswd.conf
            owner=root group=root
  when: voms_htpasswd is defined

#FIXME: Temp workaround for tenants without BDII infrastructure.
66
67
68
69
- name: Copy broker-list file
  template: src=broker-list.j2
            dest=/var/cache/msg/broker-cache-file/broker-list
            owner=root group=root mode=0644
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
110
111
112
113
114
115
116
117
118
119
120
  when: broker_host is defined
##

- name: Copy argo-msg-cache file
  template: src=argo-msg-cache.conf.j2
            dest=/etc/argo-msg-cache.conf
            owner=root group=root
  when: lcg_gfal_infosys is defined and broker_network is defined

- name: Create vomses dir
- file: path=/etc/vomses 
        state=directory 
        owner=root group=root mode=0755
  when: vomses is defined

- name: Copy vomses files
  template: src=vomses.j2
            dest=/etc/vomses/{{ item.name }}
            owner=root group=root mode=0644
  when: vomses is defined
  with_items: vomses

- name: Create voms lsc dir
- file: path=/etc/grid-security/vomsdir/{{ item.vo }}
        state=directory 
        owner=root group=root mode=0755
  when: vomses is defined
  with_items: vomses

- name: Create voms lsc files
- template: src=voms_lsc.j2
            dest=/etc/grid-security/vomsdir/{{ item.vo }}/{{ item.server }}.lsc
            owner=root group=root mode=0644
  when: vomses is defined
  with_items: vomses

- name: Create sha checksum for dashboard config
  shell: echo -n {{ nagios_server }} | sha1sum | cut -f1 -d' '
  register: sha
  
- name: Create dashboard config for msg-to-handler
  template: src=dashboard.conf.j2
            dest=/etc/msg-to-handler.d/DASHBOARD.conf
            owner=root group=root mode=0644
  when: send_to_dashboard is defined and send_to_dashboard == "1"

- name: Create apel config for msg-to-handler
  template: src=apel.conf.j2
            dest=/etc/msg-to-handler.d/APEL.conf
            owner=root group=root mode=0644
  when: send_to_apel is defined and send_to_apel == "1"
121

122
123
124
125
126
- name: Enable nagios and httpd on boot and start service
  service: name={{ item }} state=started enabled=yes
  with_items:
    - nagios
    - httpd
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
- name: Start fetch-crl cron
  service: name=fetch-crl-cron state=started enabled=yes
  when: ca_bundle_install

- name: Start fetch-crl boot
  service: name=fetch-crl-boot state=started enabled=no
  when: ca_bundle_install
  ignore_errors: yes

- name: Enable argo-voms-htpasswd on boot and start service
  service: name=argo-voms-htpasswd state=started enabled=yes
  when: voms_htpasswd is defined

- name: Enable argo-msg-cache on boot and start service
  service: name=argo-msg-cache state=started enabled=yes
  when: lcg_gfal_infosys is defined