31 lines
1.1 KiB
YAML
31 lines
1.1 KiB
YAML
# vim:ft=ansible:
|
|
- name: assure data directory for nagios
|
|
file: path=/data/nagios state=directory mode=0755
|
|
tags: [ nagios ]
|
|
- name: assure ssmtp.conf file for nagios
|
|
file: path=/data/nagios/ssmtp.conf state=file mode=0640
|
|
tags: [ nagios ]
|
|
- name: template out config for nagios
|
|
template: src=nagios-hosts.cfg.j2 dest=/data/nagios/etc/objects/ansible.cfg owner=root group=root mode=0644
|
|
tags: [ nagios, template ]
|
|
- name: assure config file is loaded
|
|
lineinfile: path=/data/nagios/etc/nagios.cfg line='cfg_file=/opt/nagios/etc/objects/ansible.cfg'
|
|
tags: [ nagios, template ]
|
|
- name: docker deploy nagios
|
|
docker_container:
|
|
name: nagios
|
|
image: manios/nagios
|
|
env:
|
|
NAGIOSADMIN_USER: admin
|
|
NAGIOSADMIN_PASS: "{{ secret_nagios_admin_pass }}"
|
|
TZ: "America/Chicago"
|
|
networks:
|
|
- name: web
|
|
aliases: [ "nagios" ]
|
|
volumes:
|
|
- /data/nagios/etc:/opt/nagios/etc
|
|
- /data/nagios/var:/opt/nagios/var
|
|
- /data/nagios/plugins:/opt/Custom-Nagios-Plugins
|
|
- /data/nagios/ssmtp.conf:/etc/ssmtp/ssmtp.conf
|
|
tags: [ docker, nagios ]
|