Unverified Commit 6fb01a63 authored by aflatto's avatar aflatto Committed by GitHub

Merge pull request #5 from Icinga/feature/icinga2-installation

Install Icinga 2 package
parents 5f3c79a4 8d5db742
--- ---
i2_use_repository: true i2_manage_repository: true
i2_apt_key: "https://packages.icinga.com/icinga.key" i2_apt_key: "https://packages.icinga.com/icinga.key"
i2_apt_url: "deb http://packages.icinga.com/{{ ansible_distribution|lower }} icinga-{{ ansible_distribution_release }} main" i2_apt_url: "deb http://packages.icinga.com/{{ ansible_distribution|lower }} icinga-{{ ansible_distribution_release }} main"
i2_yum_key: "https://packages.icinga.com/icinga.key" i2_yum_key: "https://packages.icinga.com/icinga.key"
i2_yum_url: "http://packages.icinga.com/epel/$releasever/release/" i2_yum_url: "http://packages.icinga.com/epel/$releasever/release/"
i2_manage_package: true
i2_manage_service: true
--- ---
# handlers file for icinga2
- name: start icinga2
become: yes
service:
name: icinga2
state: started
enabled: yes
when: i2_manage_service
...@@ -17,7 +17,7 @@ galaxy_info: ...@@ -17,7 +17,7 @@ galaxy_info:
- 9 - 9
- name: Ubuntu - name: Ubuntu
versions: versions:
- 14.04 - 16.04
- 18.04 - 18.04
categories: categories:
- system - system
......
...@@ -2,17 +2,29 @@ ...@@ -2,17 +2,29 @@
- name: Debian - Install apt-transport-https - name: Debian - Install apt-transport-https
become: yes become: yes
apt: name=apt-transport-https state=present apt:
when: i2_use_repository name: apt-transport-https
state: present
when: i2_manage_repository
- name: Debian - Add Icinga 2 repository key - name: Debian - Add Icinga 2 repository key
become: yes become: yes
apt_key: url="{{ i2_apt_key }}" state=present apt_key:
when: i2_use_repository and i2_apt_key url: "{{ i2_apt_key }}"
state: present
when: i2_manage_repository and i2_apt_key
- name: Debian - Add Icinga 2 repository - name: Debian - Add Icinga 2 repository
become: yes become: yes
apt_repository: repo={{ item.repo }} state={{ item.state}} apt_repository:
with_items: repo: "{{ i2_apt_url }}"
- { repo: "{{ i2_apt_url }}", state: "present" } state: present
when: i2_use_repository when: i2_manage_repository
- name: Debian - Ensure icinga2 is installed
become: yes
apt:
name: icinga2
state: present
notify: start icinga2
when: i2_manage_package
...@@ -2,5 +2,18 @@ ...@@ -2,5 +2,18 @@
- name: RedHat - Add Icinga 2 repository - name: RedHat - Add Icinga 2 repository
become: yes become: yes
template: src=ICINGA-release.repo dest=/etc/yum.repos.d/ICINGA-release.repo yum_repository:
when: i2_use_repository name: ICINGA-release
description: Icinga packages for EL
baseurl: "{{ i2_yum_url }}"
gpgkey: "{{ i2_yum_key }}"
gpgcheck: yes
when: i2_manage_repository
- name: RedHat - Ensure icinga2 is installed
become: yes
yum:
name: icinga2
state: present
notify: start icinga2
when: i2_manage_package
...@@ -3,3 +3,10 @@ ...@@ -3,3 +3,10 @@
include: icinga2.yml include: icinga2.yml
tags: tags:
- install - install
- name: Make sure Icinga 2 is started
service:
name: icinga2
state: started
enabled: yes
when: i2_manage_service
[icinga-stable-release]
name=ICINGA (stable release for epel)
baseurl={{ i2_yum_url }}
enabled=1
gpgcheck=1
gpgkey={{ i2_yum_key }}
\ No newline at end of file
...@@ -4,5 +4,3 @@ ...@@ -4,5 +4,3 @@
remote_user: root remote_user: root
roles: roles:
- icinga2 - icinga2
vars:
- i2_use_repository: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment