2021-01-04 22:49:46 +01:00

162 lines
3.8 KiB
YAML

---
- name: Installation apache2
apt: name=apache2 state=present
- name: Installation snmp
apt: name=snmp state=present
- name: Installation de icinga
apt: name=icinga state=present
- name: Installation de nagios-plugins
apt: name=nagios-plugins state=present
- name: Installation de nagios-snmp-plugins
apt: name=nagios-snmp-plugins state=present
- name: Installation des dépendances dns
apt: name=libnet-dns-perl state=present
#- name: Copie de fichier apache.conf
# copy: remote_src=true src=/etc/icinga/apache2.conf dest=/etc/apache2/sites-available/icinga.conf
#- name: activation du site de icinga
# shell: a2ensite icinga
# notify:
# - restart icinga
- name: changement de mot de passe de icingaadmin
shell: htpasswd -dbc /etc/icinga/htpasswd.users icingaadmin root
- name: Copie du fichier commands.cfg
copy: src=commands.cfg dest=/etc/icinga/commands.cfg
- name: Copie du fichier icinga.cfg
copy: src=icinga.cfg dest=/etc/icinga
- name: Copie du fichier contact
copy: src=contacts_icinga.cfg dest=/etc/icinga/objects
- name: Copie du fichier s-test.cfg
copy: src=cfg/s-test.cfg dest=/etc/icinga/objects
notify:
- restart icinga
#- name: Copie du fichier s-proxy.cfg
# copy: src=cfg/s-proxy.cfg dest=/etc/icinga/objects
# notify:
# - restart icinga
- name: Copie du fichier s-adm.cfg
copy: src=cfg/s-adm.cfg dest=/etc/icinga/objects
notify:
- restart icinga
#- name: Copie du fichier r-int.cfg
# copy: src=cfg/r-int.cfg dest=/etc/icinga/objects
# notify:
# - restart icinga
#- name: Copie du fichier r-ext.cfg
# copy: src=cfg/r-ext.cfg dest=/etc/icinga/objects
# notify:
# - restart icinga
#- name: Copie du fichier netgear
# copy: src=cfg/netgear.cfg dest=/etc/icinga/objects
# notify:
# - restart icinga
- name: Copie du fichier serveur
copy: src=cfg/s-win.cfg dest=/etc/icinga/objects
notify:
- restart icinga
#- name: Copie du fichier gwsio2
# copy: src=cfg/gwsio2.cfg dest=/etc/icinga/objects
# notify:
# - restart icinga
#- name: Copie du fichier s-fog
# copy: src=cfg/s-fog.cfg dest=/etc/icinga/objects
# notify:
# - restart icinga
- name: Copie du fichier hostgroup
copy: src=hostgroups_icinga.cfg dest=/etc/icinga/objects
notify:
- restart icinga
- name: Copie du fichier services
copy: src=services_icinga.cfg dest=/etc/icinga/objects
notify:
- restart icinga
#- name: attribution des droits dossier icinga rw
# file:
# path: /var/lib/icinga/rw
# owner: nagios
# mode: 2710
# recurse: yes
# notify:
# - restart icinga
#- name: attribution des droits dossier icinga
# file:
# path: /var/lib/icinga
# owner: nagios
# mode: 751
# recurse: yes
# notify:
# - restart icinga
#- file:
# path: /var/lib/icinga/rw
# state: directory
# mode: 2770
# notify:
# - stop icinga
#- name: attribution des droits dossier var lib icinga
# shell: chmod 2770 /var/lib/icinga/rw
# notify:
# - stop icinga
#- name: attribution des droits dossier var lib icinga
# file:
# path: /var/lib/icinga/rw
# owner: www-data
# mode: 2710
# recurse: yes
# notify:
# - restart icinga
#- service:
# name: apache2
# state: restarted
# notify:
# - start icinga
#- name: attribution des droits dossier var lib icinga
# shell: apache2ctl restart
# notify:
# - start icinga
- name: Changement droit notif
shell: chmod 644 /var/log/icinga/icinga.log
- name: copie nt.cfg
copy: src=nt.cfg dest=/etc/nagios-plugins/config
#- name: copie dns.cfg
# copy: remote_src=true src=dns.cfg dest=/etc/nagios-plugins/config
- name: copie check traffic
copy: src=check_iftraffic3.pl dest=/usr/lib/nagios/plugins
- name: modif des droits plugin traffic
shell: chmod 755 /usr/lib/nagios/plugins/check_iftraffic3.pl
- name: message d'information
debug: msg="Pour superviser le Windows, il faut installer NSClient++"