Skip to content
Permalink
Browse files

Code style fixes & cleanup -> towards fully automated install includi…

…ng module selection (#101)

* First steps into bringing the playbooks in line with best practices

* Cleaned up unused file

Signed-off-by: Mark Laagland <mark@taggle-it.nl>

* Removed undocumented and defective PostgreSQL option

Function prevents setting up MySQL, but then goes on to create a MySQL database and MySQL user and import a schema. Clearly this functionality is far from complete (and should be implemented in a different manner anyway)

Signed-off-by: Mark Laagland <mark@taggle-it.nl>

* Simplified icinga2-ansible-web2-ui role and combined scripts for different OS families where possible, improving maintainability.

Signed-off-by: Mark Laagland <mark@taggle-it.nl>

* Removed incomplete support for RedHat OS family version 6.

Not only is this version very outdated (though admittedly still in the last phase of free support), the support in this playbook could have never worked since it would first install (php and) php-fpm for php version 7.0, before editing a configuration file for php 7.1.

Signed-off-by: Mark Laagland <mark@taggle-it.nl>
  • Loading branch information...
Bitblade authored and aflatto committed May 16, 2019
1 parent 52565f6 commit 9c08433154286c9388a0bc5e753c3032e4835c27
Showing with 413 additions and 1,226 deletions.
  1. +8 −6 icinga2-ansible-add-hosts/handlers/main.yml
  2. +0 −128 icinga2-ansible-add-hosts/meta/main.yml
  3. +7 −6 icinga2-ansible-add-hosts/tasks/icinga2_add_hosts.yml
  4. +12 −9 icinga2-ansible-classic-ui/handlers/main.yml
  5. +0 −124 icinga2-ansible-classic-ui/meta/main.yml
  6. +13 −11 icinga2-ansible-classic-ui/tasks/icinga2_classic_ui_Debian_install.yml
  7. +42 −29 icinga2-ansible-classic-ui/tasks/icinga2_classic_ui_Gentoo_install.yml
  8. +11 −9 icinga2-ansible-classic-ui/tasks/icinga2_classic_ui_RedHat_install.yml
  9. +0 −2 icinga2-ansible-classic-ui/vars/main.yml
  10. +4 −3 icinga2-ansible-no-ui/handlers/main.yml
  11. +0 −129 icinga2-ansible-no-ui/meta/main.yml
  12. +26 −20 icinga2-ansible-no-ui/tasks/icinga2_Debian_MySQL_install.yml
  13. +8 −5 icinga2-ansible-no-ui/tasks/icinga2_Gentoo_MySQL_install.yml
  14. +19 −15 icinga2-ansible-no-ui/tasks/icinga2_RedHat_MySQL_install.yml
  15. +3 −5 icinga2-ansible-no-ui/tasks/icinga2_Ubuntu_MySQL_install.yml
  16. +15 −13 icinga2-ansible-no-ui/tasks/icinga2_configure.yml
  17. +14 −4 icinga2-ansible-no-ui/tasks/main.yml
  18. +0 −2 icinga2-ansible-no-ui/vars/main.yml
  19. +8 −6 icinga2-ansible-web-ui/handlers/main.yml
  20. +0 −124 icinga2-ansible-web-ui/meta/main.yml
  21. +34 −23 icinga2-ansible-web-ui/tasks/icinga2_web_ui_RedHat_install.yml
  22. +33 −27 icinga2-ansible-web-ui/tasks/icinga2_web_ui_mysql_RedHat_install.yml
  23. +0 −2 icinga2-ansible-web-ui/vars/main.yml
  24. +1 −4 icinga2-ansible-web2-ui/defaults/main.yml
  25. +8 −6 icinga2-ansible-web2-ui/handlers/main.yml
  26. +0 −141 icinga2-ansible-web2-ui/meta/main.yml
  27. +56 −0 icinga2-ansible-web2-ui/tasks/icinga2_web2_create_databases.yml
  28. +2 −2 icinga2-ansible-web2-ui/tasks/icinga2_web2_modules_install.yml
  29. +12 −74 icinga2-ansible-web2-ui/tasks/icinga2_web2_ui_Debian_install.yml
  30. +8 −112 icinga2-ansible-web2-ui/tasks/icinga2_web2_ui_RedHat_install.yml
  31. +4 −1 icinga2-ansible-web2-ui/tasks/main.yml
  32. +0 −16 icinga2-ansible-web2-ui/tasks/terraform.tfstate
  33. +7 −0 icinga2-ansible-web2-ui/vars/Debian.yml
  34. +8 −0 icinga2-ansible-web2-ui/vars/RedHat.yml
  35. +8 −6 icinga2-nrpe-agent/handlers/main.yml
  36. +0 −127 icinga2-nrpe-agent/meta/main.yml
  37. +4 −5 icinga2-nrpe-agent/tasks/icinga2_nrpe_agent_Debian.yml
  38. +12 −10 icinga2-nrpe-agent/tasks/icinga2_nrpe_agent_Gentoo.yml
  39. +17 −15 icinga2-nrpe-agent/tasks/icinga2_nrpe_agent_RedHat.yml
  40. +9 −3 icinga2-nrpe-agent/tasks/main.yml
  41. +0 −2 icinga2-nrpe-agent/vars/main.yml
@@ -2,11 +2,13 @@
# handlers file for icinga2-ansible-add-hosts

- name: restart icinga2
service: name=icinga2
state=restarted
enabled=yes
service:
name: icinga2
state: restarted
enabled: yes

- name: reload icinga2
service: name=icinga2
state=reloaded
enabled=yes
service:
name: icinga2
state: reloaded
enabled: yes

This file was deleted.

@@ -1,10 +1,11 @@
---
- name: Copy Host Definitions
template: src=hosts_template.j2
dest={{ icinga2_hosts_dir }}/{{ hostvars[item]['ansible_fqdn'] }}.conf
owner=root
group=root
mode=0644
with_items: "{{ groups['all'] }}"
template:
src: hosts_template.j2
dest: "{{ icinga2_hosts_dir }}/{{ hostvars[item]['ansible_fqdn'] }}.conf"
owner: root
group: root
mode: 0644
loop: "{{ groups['all'] }}"
notify:
- reload icinga2
@@ -2,16 +2,19 @@
# handlers file for icinga2-ansible-classic-ui

- name: restart httpd
service: name=httpd
state=restarted
enabled=yes
service:
name: httpd
state: restarted
enabled: yes

- name: restart apache2
service: name=apache2
state=restarted
enabled=yes
service:
name: apache2
state: restarted
enabled: yes

- name: restart icinga2
service: name=icinga2
state=restarted
enabled=yes
service:
name: icinga2
state: restarted
enabled: yes

This file was deleted.

@@ -1,19 +1,21 @@
---
- name: Install Icinga Classic UI on Debian OS family
apt: pkg={{ item }}
state=latest
update_cache=yes
cache_valid_time=30
with_items: "{{ icinga2_classic_ui_pkg }}"
apt:
pkg: "{{ icinga2_classic_ui_pkg }}"
state: latest
update_cache: yes
cache_valid_time: 30

- name: Configure a password for icingaadmin user
htpasswd: name=icingaadmin
state=present
path={{ htpasswd_deb }}
create=no
password={{ icinga2_classic_ui_passwd }}
htpasswd:
name: icingaadmin
state: present
path: "{{ htpasswd_deb }}"
create: no
password: "{{ icinga2_classic_ui_passwd }}"
notify:
- restart apache2

- name: Icinga Classic UI Installation finished (Debian)
debug: msg="Login at http://IP/icinga2-classicui with user icingaadmin and password {{ icinga2_classic_ui_passwd }}"
debug:
msg: "Login at http://IP/icinga2-classicui with user icingaadmin and password {{ icinga2_classic_ui_passwd }}"

0 comments on commit 9c08433

Please sign in to comment.
You can’t perform that action at this time.