From 97f8901dbc9adb1028fc0e59c3a5fed6c0e96006 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 15 Jan 2018 18:24:40 +0100 Subject: [PATCH] nagios: the Dell repository slightly changed, adapt to it. SAN hosts: configure dlibsan11.san.research-infrastructures.eu, see https://support.d4science.org/issues/10937 --- nagios/defaults/main.yml | 5 +--- nagios/tasks/dell-omsa.yml | 25 ++++++++----------- .../templates/linux.dell.com.sources.list.j2 | 6 ++--- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/nagios/defaults/main.yml b/nagios/defaults/main.yml index 178ac3cf..ffa0e401 100644 --- a/nagios/defaults/main.yml +++ b/nagios/defaults/main.yml @@ -63,10 +63,7 @@ nagios_dell_omsa_deps: nagios_dell_omsa_pkg_state: present nagios_dell_omsa_pkgs: - - srvadmin-base - - srvadmin-idrac - - srvadmin-storageservices - - srvadmin-omcommon + - srvadmin-all # We need a more recent version of the check_openmanage executable nagios_dell_standalone_checks: diff --git a/nagios/tasks/dell-omsa.yml b/nagios/tasks/dell-omsa.yml index eae49ee9..58389645 100644 --- a/nagios/tasks/dell-omsa.yml +++ b/nagios/tasks/dell-omsa.yml @@ -1,16 +1,15 @@ --- # The internal repository is used for the check-openmanage nagios plugin: # http://folk.uio.no/trondham/software/check_openmanage.html -- name: research infrastructures system repository on ubuntu - apt_repository: repo='deb http://ppa.research-infrastructures.eu/system stable main' - when: is_ubuntu - register: update_apt_cache - tags: [ 'dell', 'nagios' ] - - name: Install the NeMIS internal repository apt key apt_key: url=http://ppa.research-infrastructures.eu/system/keys/system-archive.asc state=present tags: [ 'dell', 'nagios' ] +- name: research infrastructures system repository on ubuntu + apt_repository: repo='deb http://ppa.research-infrastructures.eu/system stable main' state=present update_cache=yes + when: is_ubuntu + tags: [ 'dell', 'nagios' ] + - name: research infrastructures system repository on debian copy: src={{ item }} dest=/etc/apt/sources.list.d/{{ item }} with_items: @@ -30,18 +29,16 @@ tags: [ 'dell', 'nagios' ] - name: Install the Dell apt repository - template: src={{ item }}.j2 dest=/etc/apt/sources.list.d/{{ item }} - with_items: - - linux.dell.com.sources.list + apt_repository: repo='deb http://linux.dell.com/repo/community/ubuntu {{ ansible_distribution_release }} openmanage' update_cache=yes tags: [ 'dell', 'nagios' ] - name: Install the Dell OMSA packages dependencies - apt: pkg={{ item }} state=installed force=yes update_cache=yes + apt: pkg={{ item }} state=installed force=yes update_cache=yes cache_valid_time=1800 with_items: '{{ nagios_dell_omsa_deps }}' tags: [ 'dell', 'nagios' ] - name: Install other Dell OMSA packages dependencies - apt: pkg={{ item }} state=installed + apt: pkg={{ item }} state=installed update_cache=yes cache_valid_time=1800 with_items: - python-requests register: requests_pkg @@ -49,7 +46,7 @@ tags: [ 'dell', 'nagios' ] - name: Install the python-pip package if requests is not available as a package - apt: pkg={{ item }} state=installed + apt: pkg={{ item }} state=installed update_cache=yes cache_valid_time=1800 with_items: - python-pip when: requests_pkg|failed @@ -74,13 +71,13 @@ tags: [ 'dell', 'nagios' ] - name: Install the main Dell OMSA package - apt: pkg={{ item }} state={{ nagios_dell_omsa_pkg_state }} force=yes + apt: pkg={{ item }} state={{ nagios_dell_omsa_pkg_state }} force=yes update_cache=yes cache_valid_time=1800 with_items: - syscfg tags: [ 'dell', 'nagios' ] - name: Install the Dell OMSA packages - apt: pkg={{ item }} state={{ nagios_dell_omsa_pkg_state }} force=yes + apt: pkg={{ item }} state={{ nagios_dell_omsa_pkg_state }} force=yes update_cache=yes cache_valid_time=1800 with_items: '{{ nagios_dell_omsa_pkgs }}' notify: Start Dell OMSA tags: [ 'dell', 'nagios' ] diff --git a/nagios/templates/linux.dell.com.sources.list.j2 b/nagios/templates/linux.dell.com.sources.list.j2 index 0bd850fd..6583d6ac 100644 --- a/nagios/templates/linux.dell.com.sources.list.j2 +++ b/nagios/templates/linux.dell.com.sources.list.j2 @@ -1,5 +1,5 @@ -{% if ( is_debian8 ) or ( is_debian7 ) %} -deb http://linux.dell.com/repo/community/ubuntu wheezy openmanage -{% else %} +{% if is_ubuntu %} deb http://linux.dell.com/repo/community/ubuntu {{ ansible_distribution_release }} openmanage +{% else %} +deb http://linux.dell.com/repo/community/ubuntu wheezy openmanage {% endif %}