Skip to content

Commit

Permalink
Merge pull request #10 from CoffeeITWorks/develop
Browse files Browse the repository at this point in the history
1.2.0 restructure the role, update molecule, add thruk_local_additional_options
  • Loading branch information
pablodav authored Jun 5, 2020
2 parents 6ee8432 + e174400 commit a2940ea
Show file tree
Hide file tree
Showing 23 changed files with 194 additions and 340 deletions.
37 changes: 31 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/CoffeeITWorks/ansible_nagios4_server_thruk.svg?branch=master)](https://travis-ci.org/CoffeeITWorks/ansible_nagios4_server_thruk)

Role Name
=========

Expand Down Expand Up @@ -78,13 +80,36 @@ Complete list of roles for your site:
hosts: nagios_servers
become: yes
become_method: sudo
pre_tasks:
- name: installing python-3 mysql libraries
apt: name=python3-mysqldb state=present
when: ansible_os_family == 'Debian'

roles:
- { role: nagios_server, tags: ["install", "nagios_server_all", "nagios_server"] }
- { role: nagios_server_plugins, tags: ["install", "nagios_server_all", "nagios_server_plugins"] }
- { role: nagios_server_pnp4nagios, tags: ["install", "nagios_server_all", "nagios_server_pnp4nagios"] }
- { role: ANXS.mysql, tags: ["install", "nagios_server_all", "nagios_server_thruk", "ANXS.mysql"] }
- { role: nagios_server_thruk, tags: ["install", "nagios_server_all", "nagios_server_thruk"] }
- { role: postfix_client, tags: ["install", "nagios_server_all", "postfix_client"] }
- role: geerlingguy.mysql
tags:
- mysql
- nagios
- role: ansible-role-nagios
tags:
- nagios
- role: coffeeitworks.ansible_nagios4_server_config
tags:
- nagios
#- role: nagios_server_plugins
# tags:
# - nagios
#- role: nagios_server_pnp4nagios
# tags:
# - nagios
- role: ansible_nagios4_server_thruk
tags:
- nagios

#- role: postfix_client
# tags:
# - postfix_client

# Additional tags: role/tag
# nagios_server - config_nagios
# nagios_server - nagios_server_main_config
Expand Down
16 changes: 16 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,19 @@ nsca_config_file: /etc/nsca.cfg

nagios_live_sock: "/usr/local/nagios/var/rw/live.sock"
nagios_config_broker_module: "/usr/local/lib/mk-livestatus/livestatus.o {{ nagios_live_sock }}"

thruk_local_additional_options:
- comment: "# default states for commands option checkboxes"
section: <cmd_defaults>
options:
- ahas = 0 # For Hosts Too
- broadcast_notification = 0 # Broadcast
- force_check = 0 # Forced Check
- force_notification = 0 # Forced Notification
- send_notification = 1 # Send Notification
- sticky_ack = 0 # Sticky Acknowledgement
- persistent_comments = 1 # Persistent Comments
- persistent_ack = 1 # Persistent Acknowledgement Comments
- ptc = 0 # For Child Hosts Too
- use_expire = 0 # Use expire for acknowledgements (for cores which support this)
end_section: </cmd_defaults>
7 changes: 7 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
- name: Converge
hosts: all
become: yes
pre_tasks:
- name: installing python-3 mysql libraries
apt:
name: python3-pymysql
state: present
update_cache: yes
when: ansible_os_family == 'Debian'
roles:
- role: geerlingguy.mysql
- role: ansible-role-nagios
Expand Down
14 changes: 1 addition & 13 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ platforms:
- use_pip_package

- name: ansible_nagios4_server_thruk-02
image: "geerlingguy/docker-debian9-ansible"
image: "geerlingguy/docker-ubuntu1604-ansible:latest"
#privileged: True
command: /sbin/init
pre_build_image: true
Expand All @@ -39,18 +39,6 @@ platforms:
groups:
- use_pip_package

- name: ansible_nagios4_server_thruk-03
image: docker.io/pycontribs/centos:7
pre_build_image: true
command: /sbin/init
capabilities:
- SYS_ADMIN
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
#privileged: True
groups:
- use_dev_package

provisioner:
name: ansible
config_options:
Expand Down
24 changes: 0 additions & 24 deletions molecule/local/Dockerfile.j2

This file was deleted.

16 changes: 0 additions & 16 deletions molecule/local/INSTALL.rst

This file was deleted.

59 changes: 0 additions & 59 deletions molecule/local/create.yml

This file was deleted.

27 changes: 0 additions & 27 deletions molecule/local/destroy.yml

This file was deleted.

75 changes: 0 additions & 75 deletions molecule/local/molecule.yml

This file was deleted.

9 changes: 0 additions & 9 deletions molecule/local/playbook.yml

This file was deleted.

5 changes: 0 additions & 5 deletions molecule/local/prepare.yml

This file was deleted.

14 changes: 0 additions & 14 deletions molecule/local/tests/test_default.py

This file was deleted.

Binary file removed molecule/local/tests/test_default.pyc
Binary file not shown.
3 changes: 1 addition & 2 deletions tasks/config_nagios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
dest: '{{ item.dest }}'
owner: 'root'
group: 'root'
mode: 0644
mode: "0644"
with_items:
- { src: 'localhost_thruk.cfg.j2', dest: '{{ nagios_config_cfg_dir }}/localhost_thruk.cfg' }
notify: Reload Nagios

Loading

0 comments on commit a2940ea

Please sign in to comment.