Skip to content

Commit

Permalink
Code style fixes & cleanup -> towards fully automated install includi…
Browse files Browse the repository at this point in the history
…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 9c08433
Show file tree
Hide file tree
Showing 41 changed files with 413 additions and 1,226 deletions.
14 changes: 8 additions & 6 deletions icinga2-ansible-add-hosts/handlers/main.yml
Expand Up @@ -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
128 changes: 0 additions & 128 deletions icinga2-ansible-add-hosts/meta/main.yml

This file was deleted.

13 changes: 7 additions & 6 deletions icinga2-ansible-add-hosts/tasks/icinga2_add_hosts.yml
@@ -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
21 changes: 12 additions & 9 deletions icinga2-ansible-classic-ui/handlers/main.yml
Expand Up @@ -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
124 changes: 0 additions & 124 deletions icinga2-ansible-classic-ui/meta/main.yml

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.