Files
fedora-infra_ansible/playbooks/groups/noc.yml
Greg Sutcliffe 8bea488272 Zabbix: Add Datanommer monitoring to noc01
Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
2025-12-09 16:59:35 +00:00

78 lines
2.0 KiB
YAML

# This is a basic playbook
---
- import_playbook: "/srv/web/infra/ansible/playbooks/include/virt-create.yml"
vars:
myhosts: "nagios"
- name: Make the box be real
hosts: nagios
user: root
gather_facts: true
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
pre_tasks:
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
roles:
- base
- rkhunter
- nagios_client
- hosts
- { role: openvpn/client, when: env != "staging" }
- zabbix/zabbix_agent
- ipa/client
- collectd/base
- { role: rsyncd, when: datacenter == 'rdu3' }
- sudo
- apache
# - mod_wsgi
- role: keytab/service
owner_user: apache
owner_group: apache
service: HTTP
host: "nagios{{env_suffix}}.fedoraproject.org"
when: datacenter == 'rdu3'
- role: keytab/service
owner_user: apache
owner_group: apache
service: HTTP
host: "nagios-external{{env_suffix}}.fedoraproject.org"
when: datacenter == 'ibiblio'
- { role: letsencrypt, site_name: 'nagios-external.fedoraproject.org', when: inventory_hostname.startswith('noc02') }
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
- name: Deploy service-specific config (just for production)
hosts: nagios
user: root
gather_facts: true
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
roles:
- { role: dhcp_server, when: datacenter == 'rdu3' }
- { role: tftp_server, when: datacenter == 'rdu3' }
- { role: firmware_proxy, when: datacenter == 'rdu3' }
- { role: nagios_server, when: datacenter == 'ibiblio' or datacenter == 'rdu3' }
- { role: zabbix/datanommer, when: datacenter == 'rdu3' }
tasks:
- name: Install some packages which arent in playbooks
ansible.builtin.package:
state: present
name:
- nmap
- tcpdump
- ipmitool