From d97d73439fcf29268f946ad2637226c530e261dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Thu, 28 Mar 2019 14:49:51 +0100 Subject: [PATCH] Allow to install web interface for OMSA --- CHANGELOG.md | 1 + README.md | 17 +++++++++++++++-- defaults/main.yml | 21 +++++++++++++++++++++ tasks/main.yml | 15 ++++++++++++++- 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc514c4..048b036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## v1.X.Y ### Enhancements +* Allow to install web interface for OMSA. * Install idrac8 (and above) package by default. * Install libssl.1.0.0 from Dell repo as base package. * Install libxslt1.1 as dependency for om.* apps. diff --git a/README.md b/README.md index 93f8d5d..8f6393d 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,12 @@ A role to manage Openmanage installation and configuration. ## Role Variables * **openmanage__repositories** : List of APT repositories that can provide OpenManage. Each entry is a dict [default : `See default/main.yml`]. -* **openmanage__deploy_state** : The desired state this role should achieve. [default for Dell hardware : `present`]. -* **openmanage__install_recommends** : If recommended packages should be install. [default : `False`]. +* **openmanage__deploy_state** : The desired state this role should achieve [default for Dell hardware : `present`]. +* **openmanage__install_recommends** : If recommended packages should be install [default : `False`]. * **openmanage__dep_packages** : List of dependencies packages to be able to run racadm [default : `See default/main.yml`]. * **openmanage__base_packages** : List of base packages for all racadm base usage [default : `See default/main.yml`]. +* **openmanage__webgui_state** : The desired state for web interface of OMSA [default  : `absent`]. +* **openmanage__webgui_packages** : List of packages to provide web interface to OMSA [default : `See default/main.yml`]. ## Example Playbook @@ -31,12 +33,23 @@ A role to manage Openmanage installation and configuration. tags: ['role::openmanage', 'ipr', 'idrac'] ``` +* Enable web interface for OMSA (on https://:1311/) : + +``` yaml +- hosts: mynode.DOMAIN + roles: + - role: ipr-cnrs.openmanage + openmanage__webgui_state: "present" + tags: ['role::openmanage', 'ipr', 'idrac'] +``` + ## Configuration This role will : * Add an APT repository in order to provide OpenManage. * Install dependencies packages. * Install basic packages for all racadm usage. +* Install and enable web interface on https://:1311 if requested. * Fix idrac7's executable permissions. * Fix libssl error RAC1170. diff --git a/defaults/main.yml b/defaults/main.yml index 88fe22f..9f4f963 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -87,4 +87,25 @@ openmanage__base_packages: - 'srvadmin-server-snmp' - 'srvadmin-storageservices' # ]]] +# .. envvar:: openmanage__webgui_state [[[ +# +# What is the desired state for web interface of OMSA ? Possible options : +# +# ``absent`` +# Default. Ensure that service is stopped and packages related to web interface +# are uninstalled. +# +# ``present`` +# Install related packages and start the service. +# +openmanage__webgui_state: "absent" + # ]]] +# .. envvar:: openmanage__webgui_packages [[[ +# +# List of packages to provide web interface to OMSA. +# +openmanage__webgui_packages: + - 'srvadmin-webserver' + # ]]] + # ]]] diff --git a/tasks/main.yml b/tasks/main.yml index 429d304..8e61107 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -53,7 +53,7 @@ until: pkg_dep_result is success when: (openmanage__deploy_state == "present") - ## Manage base system packages +## Manage base system packages - name: Ensure base packages are in there desired state package: name: '{{ item }}' @@ -64,6 +64,19 @@ register: pkg_base_result until: pkg_base_result is success +## Manage webgui packages +- name: Ensure webgui packages are in there desired state + package: + name: '{{ item }}' + state: '{{ "present" if (openmanage__deploy_state == "present") and + (openmanage__webgui_state == "present") + else "absent" }}' + install_recommends: '{{ openmanage__install_recommends | bool }}' + with_flattened: + - '{{ openmanage__webgui_packages | to_nice_json }}' + register: pkg_webgui_result + until: pkg_webgui_result is success + # Executable [[[1 ## Fix some permissions - name: Ensure Executables can be run