[icinga-checkins] icinga.org: icinga2-ansible/master: Added support for Fedora 20

git at icinga.org git at icinga.org
Sat Jun 7 13:16:05 CEST 2014


Module: icinga2-ansible
Branch: master
Commit: 765e4cafaf9aa3daec1f097654fd9edd1a879c5d
URL:    https://git.icinga.org/?p=icinga2-ansible.git;a=commit;h=765e4cafaf9aa3daec1f097654fd9edd1a879c5d

Author: Valentino Gagliardi <valentino.g at servermanaged.it>
Date:   Sat Jun  7 11:32:12 2014 +0200

Added support for Fedora 20

---

 README.md                                  |    4 +++-
 handlers/handlers.yml                      |    4 ++++
 tasks/icinga2_classicui_install_Fedora.yml |   17 ++++++++++++++++
 tasks/icinga2_classicui_install_RedHat.yml |    2 +-
 tasks/icinga2_install_Fedora.yml           |   17 ++++++++++++++++
 tasks/main.yml                             |   10 ++++++++--
 vars/Fedora_Heisenbug.yml                  |   30 ++++++++++++++++++++++++++++
 7 files changed, 80 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index abdd729..4841f54 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,9 @@
 
 #### Platform - Prereq - Disclaimer
 
-Tested platforms: CentOS 6.5 x64 - Debian Wheezy x64 - Ubuntu Trusty x64. This playbook is intended to be run against a fresh server!
+Tested on: CentOS 6.5 x64 - Debian Wheezy x64 - Ubuntu Trusty x64 - Fedora 20
+
+This playbook is intended to be run against a fresh server!
 
 #### Usage: installation
 
diff --git a/handlers/handlers.yml b/handlers/handlers.yml
index 47d9cf0..157aa87 100644
--- a/handlers/handlers.yml
+++ b/handlers/handlers.yml
@@ -13,3 +13,7 @@
            state=restarted 
            enabled=yes
 
+- name: restart firewalld
+  service: name=firewalld.service
+           state=restarted 
+           enabled=yes
diff --git a/tasks/icinga2_classicui_install_Fedora.yml b/tasks/icinga2_classicui_install_Fedora.yml
new file mode 100644
index 0000000..5760102
--- /dev/null
+++ b/tasks/icinga2_classicui_install_Fedora.yml
@@ -0,0 +1,17 @@
+- name: Install Icinga classicgui for CentOS OS family (Fedora)
+  yum: name={{ item.package }} state=latest
+  with_items: icinga2_web_pkg
+  notify:
+   - restart icinga2
+   - restart apache
+
+- name: Open port 80 on firewall
+  firewalld: port={{ item.port }}
+             state={{ item.state }}
+             permanent=yes
+  with_items: firewalld_ports
+  notify:
+   - restart firewalld
+
+- name: Icinga Classic Gui Installation finished (Fedora)
+  debug: msg="Now you can login at http://{{ ansible_eth0.ipv4.address }}/icinga with username icingaadmin and password icingaadmin"
diff --git a/tasks/icinga2_classicui_install_RedHat.yml b/tasks/icinga2_classicui_install_RedHat.yml
index 5b03176..7896647 100644
--- a/tasks/icinga2_classicui_install_RedHat.yml
+++ b/tasks/icinga2_classicui_install_RedHat.yml
@@ -5,5 +5,5 @@
    - restart icinga2
    - restart apache
 
-- name: Icinga Classic Gui Installation finished
+- name: Icinga Classic Gui Installation finished (CentOS)
   debug: msg="Now you can login at http://{{ ansible_eth0.ipv4.address }}/icinga with username icingaadmin and password icingaadmin"
diff --git a/tasks/icinga2_install_Fedora.yml b/tasks/icinga2_install_Fedora.yml
new file mode 100644
index 0000000..e75dbc1
--- /dev/null
+++ b/tasks/icinga2_install_Fedora.yml
@@ -0,0 +1,17 @@
+---
+- name: Install prerequisites on CentOS OS family (Fedora)
+  yum: name={{ item.package }} state=latest
+  with_items: pre_pkg
+
+- name: Get Icinga2 Yum Key on CentOS OS family (Fedora)
+  rpm_key: key={{ icinga2_key }} state=present
+
+- name: Get Icinga2 Yum Repo on CentOS OS family (Fedora)
+  get_url: url='{{ icinga2_url_yum }}' dest={{ icinga2_repo_yum }}
+
+- name: Install Icinga2 on CentOS OS family (Fedora)
+  yum: name={{ item.package }} state=latest
+  with_items: icinga2_pkg
+  notify:
+   - restart icinga2
+
diff --git a/tasks/main.yml b/tasks/main.yml
index 7dec967..8b671b2 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -9,7 +9,10 @@
   when: ansible_os_family == 'Debian' and ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
 
 - include: icinga2_install_RedHat.yml
-  when: ansible_os_family == 'RedHat'
+  when: ansible_os_family == 'RedHat' and ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6'
+
+- include: icinga2_install_Fedora.yml
+  when: ansible_os_family == 'RedHat' and ansible_distribution == 'Fedora'
 
 - include: icinga2_classicui_install_Debian.yml
   when: ansible_os_family == 'Debian' and ansible_distribution == 'Debian' and ansible_distribution_release == 'wheezy'
@@ -18,4 +21,7 @@
   when: ansible_os_family == 'Debian' and ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
 
 - include: icinga2_classicui_install_RedHat.yml
-  when: ansible_os_family == 'RedHat'
+  when: ansible_os_family == 'RedHat' and ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6'
+
+- include: icinga2_classicui_install_Fedora.yml
+  when: ansible_os_family == 'RedHat' and ansible_distribution == 'Fedora'
diff --git a/vars/Fedora_Heisenbug.yml b/vars/Fedora_Heisenbug.yml
new file mode 100644
index 0000000..555b802
--- /dev/null
+++ b/vars/Fedora_Heisenbug.yml
@@ -0,0 +1,30 @@
+---
+pre_pkg:
+ - { package: "gpg" }
+
+icinga2_key: "http://packages.icinga.org/icinga.key"
+
+icinga2_url_yum: "http://packages.icinga.org/fedora/ICINGA-release.repo"
+icinga2_repo_yum: "/etc/yum.repos.d/ICINGA-release.repo"
+
+# Handlers variables
+
+apache: "httpd"
+
+#
+
+icinga2_pkg:
+ - { package: "icinga2" }
+ - { package: "nagios-plugins-all" }
+ - { package: "nagios-nrpe" }
+ - { package: "nagios-plugins-nrpe" }
+
+icinga2_web_pkg:
+ - { package: "icinga2-classicui-config" }
+ - { package: "icinga-gui" }
+
+firewalld_ports:
+ - { port: "80/tcp", state: "enabled" }
+
+icinga2_hosts_dir: "/etc/icinga2/conf.d/hosts/"
+



More information about the icinga-checkins mailing list