Compare commits

..

No commits in common. "master" and "v1.0.1" have entirely different histories.

7 changed files with 38 additions and 366 deletions

View File

@ -1,74 +1,6 @@
## v1.5.0
### Enhancements
* Repository version 11.0.0.0 for Debian Bookworm and Ubuntu Jammy.
## v1.4.1
### Fix
* Use flatten to manage packages list.
* Prefix module with "ansible.builtin.".
## v1.4.0
### Fix
* Use key_url instead of [deprecated SKS keyserver](https://sks-keyservers.net/).
* Truthy warnings with ansible-lint.
### Enhancements
* Repository version 10.1.0.0 for Debian Bullseye and Ubuntu Focal.
* Manage custom configuration for snmpd systemd service on Debian Buster.
The point is to fix the error message :
**snmpd[...]: error on subcontainer 'ia_addr' insert (-1)**
## v1.3.1
### Fix
* Add missing libncurses5 dependency.
## v1.3.0
### Enhancements
* Skip "Ensure to remove OpenManage related packages if requested" when it's not install (with package facts).
* Repositories for Debian Jessie and Ubuntu Trusty won't need modifications anymore with new OS release.
* Add support for Debian Buster and (not tested) Ubuntu Bionic (fix #1) with version 940.
* Manage SSL lib until Debian Stretch or Ubuntu Xenial (fix #2).
* Move packages related to 910 (Debian Stretch|Ubuntu Xenial) to a specific variable.
## v1.2.0
### Enhancements
* Install apt_key only if deploy_state = present.
* Remove all OpenManage related packages if deploy_state = absent.
* Packages installation don't need to restart service.
## v1.1.0
### 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.
* Manage systemd service that provide the web interface.
* Manage dataeng service to be able to use OpenManage apps.
* Manage apps's symlinks to be able to run from $PATH.
## v1.0.2
### Fix
* Set the correct issue url.
## v1.0.1
### Fix
* Fix E405 Remote package tasks should have a retry.
## v1.0.0

View File

@ -10,23 +10,15 @@
## Overview
A role to manage OpenManage (via omreport, omconfig,…), it's web interface OMSA (OpenManage Server Administrator) and iDrac (with racadm)
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__stretch_packages**: List of some packages specific to Debian Stretch (or Ubuntu Xenial) and previous versions [default: `See default/main.yml`].
* **openmanage__snmpd_service_name**: SNMPD service name to manage [default : `snmpd`].
* **openmanage__snmpd_service_enabled**: If the SNMPD service should be enabled at startup [default : `true`].
* **openmanage__snmpd_service_override_path**: Path to store SNMPD custom conf [default : `/etc/systemd/system/snmpd.service.d/override.conf`].
* **openmanage__snmpd_service_override_content**: Template used to provide systemd custom conf for SNMPD service [default : `etc/systemd/system/snmpd.service.d/override.conf.j2`].
* **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`].
* **openmanage__webgui_service_name**: Name of the systemd unit to manage web interface [default: `dsm_om_connsvc`].
## Example Playbook
@ -39,27 +31,14 @@ A role to manage OpenManage (via omreport, omconfig,…), it's web interface OMS
tags: ['role::openmanage', 'ipr', 'idrac']
```
* Enable web interface for OMSA (on https://<ip_address>: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.
* Start dataeng service to be able to use OpenManage applications (omreport, omconfig,…).
* Install and enable web interface on https://<ip_address>:1311 if requested.
* Fix idrac7's executable permissions.
* Fix libssl error RAC1170 (until Debian Stretch or Ubuntu Xenial).
* Set up symlinks to be able to run apps from $PATH.
* Fix libssl error RAC1170.
## Development
@ -69,8 +48,6 @@ But feel free to send issue/PR here :)
Thanks to this [hook][gogs to github hook], Github automatically got updates from our [Gogs instance][openmanage source] :)
Thanks to @roumano
## License
[WTFPL][wtfpl website]

View File

@ -14,60 +14,24 @@
# apt_repository and apt_key.
#
openmanage__repositories:
# Version 10100 - for Debian Bookworm and Ubuntu Jammy [[[
# Force using Focal repo as Bookworm repo doesn't exist and Jammy is based on Debian Bookworm
- repo: 'deb http://linux.dell.com/repo/community/openmanage/11000/jammy jammy main'
mode: '0644'
filename: 'dell.openmanage'
key_id: '1285491434D8786F'
key_url: 'https://linux.dell.com/repo/pgp_pubkeys/0x1285491434D8786F.asc'
state: '{{ openmanage__deploy_state
if (ansible_distribution_release in ["bookworm", "jammy"])
else "absent" }}'
# ]]]
# Version 10100 - for Debian Bullseye and Ubuntu Focal [[[
# Force using Focal repo as Bullseye repo doesn't exist and Focal is based on Debian Bullseye
- repo: 'deb http://linux.dell.com/repo/community/openmanage/10100/focal focal main'
mode: '0644'
filename: 'dell.openmanage'
key_id: '1285491434D8786F'
key_url: 'https://linux.dell.com/repo/pgp_pubkeys/0x1285491434D8786F.asc'
state: '{{ openmanage__deploy_state
if (ansible_distribution_release in ["bullseye", "focal"])
else "absent" }}'
# ]]]
# Version 940 - for Debian Buster and Ubuntu Bionic [[[
# Force using Bionic repo as Buster repo doesn't exist and Bionic is based on Debian Buster
- repo: 'deb http://linux.dell.com/repo/community/openmanage/940/bionic bionic main'
mode: '0644'
filename: 'dell.openmanage'
key_id: '1285491434D8786F'
key_url: 'https://linux.dell.com/repo/pgp_pubkeys/0x1285491434D8786F.asc'
state: '{{ openmanage__deploy_state
if (ansible_distribution_release in ["buster", "bionic"])
else "absent" }}'
# ]]]
# Version 910 - for Debian Stretch and Ubuntu Xenial [[[
# Version 910 - for Debian Stretch and Ubuntu Xenial
- repo: 'deb http://linux.dell.com/repo/community/openmanage/910/{{ ansible_distribution_release }} {{ ansible_distribution_release }} main'
mode: '0644'
filename: 'dell.openmanage'
key_id: '1285491434D8786F'
key_url: 'https://linux.dell.com/repo/pgp_pubkeys/0x1285491434D8786F.asc'
key_keyserver: 'pool.sks-keyservers.net'
state: '{{ openmanage__deploy_state
if (ansible_distribution_release in ["stretch", "xenial"])
else "absent" }}'
# ]]]
# Previous OpenManage version for Debian until Jessie and Ubuntu until Trusty [[[
# Previous version for Debian until Jessie and Ubuntu until Trusty
- repo: 'deb http://linux.dell.com/repo/community/debian/dists/{{ ansible_distribution_release }} {{ ansible_distribution_release }} openmanage'
mode: '0644'
filename: 'dell.openmanage'
key_id: '1285491434D8786F'
key_url: 'https://linux.dell.com/repo/pgp_pubkeys/0x1285491434D8786F.asc'
key_keyserver: 'pool.sks-keyservers.net'
state: '{{ openmanage__deploy_state
if ((ansible_distribution == "Debian" and ansible_distribution_major_version is version("8", "<=")) or
(ansible_distribution == "Ubuntu" and ansible_distribution_version is version("14.04", "<=")))
if (ansible_distribution_release not in ["stretch", "xenial"])
else "absent" }}'
# ]]]
# ]]]
# ]]]
# Installation and Packages [[[
@ -92,12 +56,12 @@ openmanage__deploy_state: '{{ "present"
#
# If recommended packages should be install? Possible options:
#
# ``false``
# ``False``
# Default.
#
# ``true``
# ``True``
#
openmanage__install_recommends: false
openmanage__install_recommends: False
# ]]]
# .. envvar:: openmanage__dep_packages [[[
#
@ -105,8 +69,6 @@ openmanage__install_recommends: false
#
openmanage__dep_packages:
- 'libargtable2-0'
- 'libncurses5'
- 'libxslt1.1'
# ]]]
# .. envvar:: openmanage__base_packages [[[
#
@ -115,86 +77,18 @@ openmanage__dep_packages:
openmanage__base_packages:
- 'srvadmin-base'
- 'srvadmin-idracadm7'
- 'srvadmin-idracadm8'
- 'srvadmin-idrac-ivmcli'
- 'srvadmin-idrac-vmcli'
- 'srvadmin-omcommon'
- 'srvadmin-server-cli'
- 'srvadmin-server-snmp'
- 'srvadmin-storageservices'
# ]]]
# .. envvar:: openmanage__stretch_packages [[[
# .. envvar:: openmanage__idrac8_packages [[[
#
# List of some packages specific to Debian Stretch (or Ubuntu Xenial)
# and previous versions.
# List of idrac8 packages to install.
#
# Contains required packages (libssl…) and some packages that are no
# longer presents in more recent versions of OpenManage.
#
openmanage__stretch_packages:
- 'libssl1.0.0'
- 'srvadmin-idrac-ivmcli'
- 'srvadmin-idrac-vmcli'
openmanage__idrac8_packages:
- 'srvadmin-idracadm8'
# ]]]
# .. 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'
# ]]]
# ]]]
# Service management [[[
# ----------------------
# .. envvar:: openmanage__snmpd_service_name [[[
#
# SNMPD service name to manage.
openmanage__snmpd_service_name: 'snmpd'
# ]]]
# .. envvar:: openmanage__snmpd_service_enabled [[[
#
# If the SNMPD service should be enabled at startup? Possible options are:
#
# ``true``
# Default. The service is enabled.
#
# ``false``
# The service is disabled from startup.
openmanage__snmpd_service_enabled: true
# ]]]
# .. envvar:: openmanage__snmpd_service_override_path [[[
#
# Path to store SNMPD custom conf.
openmanage__snmpd_service_override_path: '/etc/systemd/system/snmpd.service.d/override.conf'
# ]]]
# .. envvar:: openmanage__snmpd_service_override_content [[[
#
# Template used to provide systemd custom conf for SNMPD service.
openmanage__snmpd_service_override_content: 'etc/systemd/system/snmpd.service.d/override.conf.j2'
# ]]]
# ]]]
# Web interface [[[
# -----------------------------
# .. envvar:: openmanage__webgui_service_name [[[
#
# Name of the systemd unit to manage web interface
#
openmanage__webgui_service_name: 'dsm_om_connsvc'
# ]]]
# ]]]

View File

@ -1,31 +0,0 @@
---
# handlers file for openmanage
- name: Restart snmpd service
systemd:
daemon_reload: '{{ (openmanage__snmpd_register_systemd_custom.changed | default(False)) }}'
state: '{{ "restarted" if (openmanage__snmpd_service_enabled)
else "stopped" }}'
name: '{{ openmanage__snmpd_service_name }}'
enabled: '{{ openmanage__snmpd_service_enabled }}'
when:
- openmanage__deploy_state == "present"
- ansible_service_mgr == 'systemd'
- name: restart dataeng service
service:
name: 'dataeng'
state: '{{ "restarted" if (openmanage__deploy_state == "present")
else "stopped" }}'
enabled: '{{ "yes" if (openmanage__deploy_state == "present")
else "no" }}'
- name: restart webgui service
service:
name: '{{ openmanage__webgui_service_name }}'
state: '{{ "restarted" if (openmanage__deploy_state == "present") and
(openmanage__webgui_state == "present")
else "stopped" }}'
enabled: '{{ "yes" if (openmanage__deploy_state == "present") and
(openmanage__webgui_state == "present")
else "no" }}'

View File

@ -4,18 +4,14 @@ dependencies: []
galaxy_info:
author: "Jérémy Gardais"
namespace: ipr-cnrs
role_name: openmanage
description: "Setup Openmanage"
license: WTFPL
company: IPR
issue_tracker_url: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.openmanage/issues
issue_tracker_url: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.netadata/issues
min_ansible_version: 2.6
platforms:
- name: Debian
versions:
- bullseye
- buster
- stretch
galaxy_tags:
- system

View File

@ -1,13 +1,13 @@
---
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
#
# tasks file for openmanage
# tasks file for netdata
# Manage repository [[[1
## Add repository
- name: Add OpenManage repository
ansible.builtin.apt_repository:
update_cache: false
apt_repository:
update_cache: False
repo: '{{ item.repo }}'
mode: '{{ item.mode | d(omit) }}'
filename: '{{ item.filename | d(omit) }}'
@ -18,27 +18,24 @@
until: openmanage__register_repositories is success
## Add repository key
### Don't remove the APT key, cause differents repos can have the same key
- name: Add OpenManage repo key
ansible.builtin.apt_key:
apt_key:
url: '{{ item.key_url | d(omit) }}'
id: '{{ item.key_id | d(omit) }}'
keyring: '/etc/apt/trusted.gpg.d/linux.dell.com.gpg'
keyserver: '{{ item.key_keyserver | d(omit) }}'
with_flattened:
- '{{ openmanage__repositories }}'
register: openmanage__register_key
until: openmanage__register_key is success
when: (openmanage__deploy_state == "present")
## Update cache
- name: Update APT cache
ansible.builtin.apt:
update_cache: '{{ true
apt:
update_cache: '{{ True
if (openmanage__register_key is changed or
openmanage__register_repositories is changed)
else
false }}'
False }}'
register: openmanage__register_update
until: openmanage__register_update is success
when: (openmanage__deploy_state == "present")
@ -46,125 +43,39 @@
# Manage packages [[[1
## Manage depencies packages
- name: Ensure dependencies are present
ansible.builtin.package:
name: '{{ openmanage__dep_packages | flatten }}'
package:
name: '{{ item }}'
state: "present"
install_recommends: '{{ openmanage__install_recommends | bool }}'
with_flattened:
- '{{ openmanage__dep_packages | to_nice_json }}'
register: pkg_dep_result
until: pkg_dep_result is success
when: (openmanage__deploy_state == "present")
## Manage Debian Stretch (or Ubuntu Xenial) specific packages
- name: "Ensure 910 specific packages (Stretch|Xenial) are in there desired state"
ansible.builtin.package:
name: '{{ openmanage__stretch_packages | flatten }}'
state: "present"
install_recommends: '{{ openmanage__install_recommends | bool }}'
register: pkg_stretch_result
until: pkg_stretch_result is success
when: (openmanage__deploy_state == "present" and
( (ansible_distribution == "Debian" and ansible_distribution_major_version is version("9", "<=")) or
(ansible_distribution == "Ubuntu" and ansible_distribution_version is version("16.04", "<="))))
## Manage base system packages
## Manage base system packages
- name: Ensure base packages are in there desired state
ansible.builtin.package:
name: '{{ openmanage__base_packages | flatten }}'
package:
name: '{{ item }}'
state: '{{ "present" if (openmanage__deploy_state == "present") else "absent" }}'
install_recommends: '{{ openmanage__install_recommends | bool }}'
with_flattened:
- '{{ openmanage__base_packages | to_nice_json }}'
register: pkg_base_result
until: pkg_base_result is success
## Manage OMSA webgui packages
- name: Ensure OMSA-webgui packages are in there desired state
ansible.builtin.package:
name: '{{ openmanage__webgui_packages | flatten }}'
state: '{{ "present" if (openmanage__deploy_state == "present") and
(openmanage__webgui_state == "present")
else "absent" }}'
install_recommends: '{{ openmanage__install_recommends | bool }}'
register: pkg_webgui_result
until: pkg_webgui_result is success
notify: ['restart webgui service']
## Remove all OpenManage packages if requested
- name: Gather the Package facts
ansible.builtin.package_facts:
manager: auto
- name: Ensure to remove OpenManage related packages if requested
ansible.builtin.package:
name: 'srvadmin*'
state: "absent"
register: pkg_remove_result
until: pkg_remove_result is success
when:
- (openmanage__deploy_state == "absent")
- "'srvadmin' in ansible_facts.packages"
# Manage configuration [[[1
- name: Create SNMPD custom directory for systemd service
ansible.builtin.file:
path: "{{ openmanage__snmpd_service_override_path | dirname }}"
state: directory
mode: '0755'
when:
- openmanage__deploy_state == "present"
- ansible_distribution_release in ["buster"]
- name: Add SNMPD systemd custom configuration
ansible.builtin.template:
src: '{{ openmanage__snmpd_service_override_content }}'
dest: '{{ openmanage__snmpd_service_override_path }}'
owner: 'root'
group: 'root'
mode: '0644'
register: openmanage__snmpd_register_systemd_custom
when:
- openmanage__deploy_state == "present"
- ansible_distribution_release in ["buster"]
notify: ['Restart snmpd service']
# Executable [[[1
## Fix some permissions
- name: Ensure Executables can be run
ansible.builtin.file:
file:
path: /opt/dell/srvadmin/sbin/racadm-wrapper-idrac7
mode: 0755
when: (openmanage__deploy_state == "present")
## Fix RAC1170 error
- name: Fix libssl error RAC1170
ansible.builtin.file:
file:
src: "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2"
path: "/opt/dell/srvadmin/lib64/libssl.so"
dest: "/opt/dell/srvadmin/lib64/libssl.so"
state: link
when: (openmanage__deploy_state == "present" and
( (ansible_distribution == "Debian" and ansible_distribution_major_version is version("9", "<=")) or
(ansible_distribution == "Ubuntu" and ansible_distribution_version is version("16.04", "<="))))
## Manage symlinks for OpenManage/racadm apps
- name: Ensure some Executables are in PATH
ansible.builtin.file:
src: "/opt/dell/srvadmin/sbin/{{ item }}"
path: "/bin/{{ item }}"
state: "link"
with_items:
- 'omconfig'
- 'omexec'
- 'omreport'
- 'omupdate'
- 'racadm'
when: (openmanage__deploy_state == "present")
- name: Remove Executables symlinks
ansible.builtin.file:
path: "/bin/{{ item }}"
state: "absent"
with_items:
- 'omconfig'
- 'omexec'
- 'omreport'
- 'omupdate'
- 'racadm'
when: (openmanage__deploy_state == "absent")

View File

@ -1,7 +0,0 @@
# {{ ansible_managed }}
[Service]
# Fix error message: snmpd[...]: error on subcontainer 'ia_addr' insert (-1)
# By fixing logging options (-Lsd to -LS6d).
ExecStart=
ExecStart=/usr/sbin/snmpd -LS6d -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f -p /run/snmpd.pid