From 8e0c1ed8305a65bc9c182818180d2a26e1403581 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 23 Jan 2019 13:10:13 +0100 Subject: [PATCH] New role to deal with the Dell hardware utilities --- dell-server-utilities/defaults/main.yml | 10 ++++++++++ dell-server-utilities/tasks/dsu_deb.yml | 1 + dell-server-utilities/tasks/dsu_rh.yml | 10 ++++++++++ dell-server-utilities/tasks/main.yml | 22 ++++++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 dell-server-utilities/defaults/main.yml create mode 100644 dell-server-utilities/tasks/dsu_deb.yml create mode 100644 dell-server-utilities/tasks/dsu_rh.yml create mode 100644 dell-server-utilities/tasks/main.yml diff --git a/dell-server-utilities/defaults/main.yml b/dell-server-utilities/defaults/main.yml new file mode 100644 index 00000000..eb8b1364 --- /dev/null +++ b/dell-server-utilities/defaults/main.yml @@ -0,0 +1,10 @@ +--- +dell_utilities_installer_url: http://linux.dell.com/repo/hardware/dsu/bootstrap.cgi +dell_utilities_base_dir: /opt/dell_dsu +dell_utilities_packages: + - dell-system-update + - srvadmin-all + - syscfg + +dell_utilities_raid_packages: + - raidcfg diff --git a/dell-server-utilities/tasks/dsu_deb.yml b/dell-server-utilities/tasks/dsu_deb.yml new file mode 100644 index 00000000..ed97d539 --- /dev/null +++ b/dell-server-utilities/tasks/dsu_deb.yml @@ -0,0 +1 @@ +--- diff --git a/dell-server-utilities/tasks/dsu_rh.yml b/dell-server-utilities/tasks/dsu_rh.yml new file mode 100644 index 00000000..8fe2ddcd --- /dev/null +++ b/dell-server-utilities/tasks/dsu_rh.yml @@ -0,0 +1,10 @@ +--- +- block: + - name: Install the RH/CentOS Dell utilities + yum: pkg={{ dell_utilities_packages }} state=latest + + when: + - "'Dell' in ansible_system_vendor" + #- ansible_system_vendor.stdout.find('Dell') != -1 + - ansible_virtualization_role == "host" + tags: [ 'dell_utilities', 'dell_dsu' ] diff --git a/dell-server-utilities/tasks/main.yml b/dell-server-utilities/tasks/main.yml new file mode 100644 index 00000000..1981432f --- /dev/null +++ b/dell-server-utilities/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- block: + - name: Create the Dell utilities directory + file: dest={{ dell_utilities_base_dir }} state=directory + + - name: Download the Dell utility installer + get_url: url={{ dell_utilities_installer_url }} dest={{ dell_utilities_base_dir }}/dsu_installer mode=0700 + + - name: Run the installer + command: '{{ dell_utilities_base_dir }}/dsu_installer' + + when: + - "'Dell' in ansible_system_vendor" + #- ansible_system_vendor.stdout.find('Dell') != -1 + - ansible_virtualization_role == "host" + tags: [ 'dell_utilities', 'dell_dsu' ] + +- import_tasks: dsu_rh.yml + when: ansible_distribution_file_variety == "RedHat" + +- import_tasks: dsu_deb.yml + when: ansible_distribution_file_variety == "Debian"