Skip to content

Commit

Permalink
Add task for Ubuntu
Browse files Browse the repository at this point in the history
Check if OS family is Debian and distribution is Ubuntu because there is no debmon repository for Ubuntu.

Fix some yamllint issues (e.g. trailing spaces)
  • Loading branch information
kallies committed Sep 26, 2016
1 parent 9d23049 commit 66ee1a4
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 27 deletions.
6 changes: 3 additions & 3 deletions icinga2-ansible-add-hosts/tasks/icinga2_add_hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
- name: Copy Host Definitions
template: src=hosts_template.j2
dest={{ icinga2_hosts_dir }}/{{ hostvars[item]['ansible_fqdn'] }}.conf
owner=root
group=root
owner=root
group=root
mode=0644
with_items: "{{ groups['all'] }}"
notify:
notify:
- restart icinga2
1 change: 0 additions & 1 deletion icinga2-ansible-add-hosts/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
---
# vars file for icinga2-ansible-add-hosts

2 changes: 1 addition & 1 deletion icinga2-ansible-classic-ui/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ icinga2_classic_ui_ebuilds:
# another webserver, but then you're on your own with configuring the webserver
icinga2_classic_ui_webserver: 'none'

# Set to file or directory, to tell the playbooks if your package.use is a file or
# Set to file or directory, to tell the playbooks if your package.use is a file or
# directory
icinga2_classic_ui_gentoo_package_use: 'file'

Expand Down
4 changes: 2 additions & 2 deletions icinga2-ansible-classic-ui/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ galaxy_info:
min_ansible_version: 1.7
#
# Below are all platforms currently available. Just uncomment
# the ones that apply to your role. If you don't see your
# the ones that apply to your role. If you don't see your
# platform on this list, let us know and we'll get it added!
#
platforms:
Expand Down Expand Up @@ -121,4 +121,4 @@ dependencies: []
# dependencies available via galaxy should be listed here.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Install Icinga Classic UI on RedHat OS family
yum: name={{ item.package }}
yum: name={{ item.package }}
state=latest
with_items: icinga2_classic_ui_rpm
notify:
Expand Down
3 changes: 2 additions & 1 deletion icinga2-ansible-no-ui/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ galaxy_info:
# - quantal
# - raring
# - saucy
- trusty
# - trusty
- xenial
#- name: SLES
# versions:
# - all
Expand Down
20 changes: 11 additions & 9 deletions icinga2-ansible-no-ui/tasks/icinga2_Debian_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@
apt: name=apt-transport-https state=present

- name: Get Icinga2 Apt Key for Debian OS family
apt_key: url={{ icinga2_key }}
apt_key: url={{ icinga2_key }}
state=present

#Debian packages require additional packages which are provided by the Debian Monitoring Project repository
# Debian packages require additional packages which are provided by the
# Debian Monitoring Project repository
- name: Get Debmon Apt Key for Debian OS family (Debian)
apt_key: url={{ icinga2_debmon_key }}
apt_key: url={{ icinga2_debmon_key }}
state=present

- name: Get Icinga2 Apt Repos for Debian OS family
apt_repository: repo='{{ item.repo }}'
update_cache=yes
apt_repository: repo='{{ item.repo }}'
update_cache=yes
state=present
with_items: '{{ icinga2_deb_repos }}'

#Debian packages require additional packages which are provided by the Debian Monitoring Project repository
# Debian packages require additional packages which are provided by the
# Debian Monitoring Project repository
- name: Get Debmon Apt Repo for Debian OS family (Debian)
apt_repository: repo='{{ icinga2_debmon_repo }}'
update_cache=yes
apt_repository: repo='{{ icinga2_debmon_repo }}'
update_cache=yes
state=present

- name: Install Icinga2 on Debian OS family
apt: pkg={{ item.package }}
apt: pkg={{ item.package }}
update_cache=yes
state=latest
install_recommends=no
Expand Down
10 changes: 5 additions & 5 deletions icinga2-ansible-no-ui/tasks/icinga2_RedHat_install.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
- name: Get Icinga2 Yum Key on RedHat OS family
rpm_key: key={{ icinga2_key }}
rpm_key: key={{ icinga2_key }}
state=present

- name: Get Icinga2 Yum Repo on RedHat OS family (Fedora)
get_url: url='{{ icinga2_url_yum_fedora }}'
get_url: url='{{ icinga2_url_yum_fedora }}'
dest={{ icinga2_repo_yum }}
when: ansible_distribution == 'Fedora'

- name: Get Icinga2 Yum Repo on RedHat OS family
get_url: url='{{ icinga2_url_yum }}'
get_url: url='{{ icinga2_url_yum }}'
dest={{ icinga2_repo_yum }}

- name: Install Icinga2 on RedHat OS family
yum: name={{ item.package }}
yum: name={{ item.package }}
state=latest
with_items: "{{ icinga2_yum }}"
when: ansible_pkg_mgr == "yum"

- name: Install Icinga2 on RedHat OS family (Fedora > 22)
dnf: name={{ item.package }}
dnf: name={{ item.package }}
state=latest
with_items: "{{ icinga2_yum }}"
when: ansible_pkg_mgr == "dnf"
Expand Down
25 changes: 25 additions & 0 deletions icinga2-ansible-no-ui/tasks/icinga2_Ubuntu_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
- name: Install https for apt (Ubuntu)
apt: name=apt-transport-https state=present

- name: Get Icinga2 Apt Key for Debian OS family
apt_key: url={{ icinga2_key }}
state=present

- name: Get Icinga2 Apt Repos for Debian OS family
apt_repository: repo='{{ item.repo }}'
update_cache=yes
state=present
with_items: '{{ icinga2_deb_repos }}'

- name: Install Icinga2 on Debian OS family
apt: pkg={{ item.package }}
update_cache=yes
state=latest
install_recommends=no
with_items: '{{ icinga2_pkg }}'

- name: Start Icinga2
service: name=icinga2
state=started
enabled=yes
4 changes: 2 additions & 2 deletions icinga2-ansible-no-ui/tasks/icinga2_configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
group=root
mode=0644
when: "{{ icinga2_conf_global | default('') | length}}"
notify:
notify:
- restart icinga2

- name: Copy Check Commands Configuration
Expand All @@ -18,5 +18,5 @@
group=root
mode=0644
when: "{{ check_commands | default('') | length}}"
notify:
notify:
- restart icinga2
7 changes: 5 additions & 2 deletions icinga2-ansible-no-ui/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
# tasks file for icinga2-ansible-no-ui

- include: icinga2_Debian_install.yml
when: ansible_os_family == 'Debian'
when: ansible_os_family == 'Debian' and ansible_distribution != 'Ubuntu'

- include: icinga2_Ubuntu_install.yml
when: ansible_os_family == 'Debian' and ansible_distribution == 'Ubuntu'

- include: icinga2_RedHat_install.yml
when: ansible_os_family == 'RedHat'
Expand All @@ -11,5 +14,5 @@
when: ansible_os_family == 'Gentoo'

- include: icinga2_configure.yml
tags:
tags:
- icinga2_configure

0 comments on commit 66ee1a4

Please sign in to comment.