Compare commits

..

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

7 changed files with 38 additions and 225 deletions

View File

@ -1,45 +1,3 @@
## 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
@ -68,7 +26,6 @@ The point is to fix the error message :
## v1.0.1
### Fix
* Fix E405 Remote package tasks should have a retry.
## v1.0.0

View File

@ -16,14 +16,9 @@ A role to manage OpenManage (via omreport, omconfig,…), it's web interface OMS
* **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__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`].
@ -58,7 +53,7 @@ This role will:
* 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).
* Fix libssl error RAC1170.
* Set up symlinks to be able to run apps from $PATH.
## Development
@ -69,8 +64,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,62 +14,26 @@
# 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,7 +69,6 @@ openmanage__install_recommends: false
#
openmanage__dep_packages:
- 'libargtable2-0'
- 'libncurses5'
- 'libxslt1.1'
# ]]]
# .. envvar:: openmanage__base_packages [[[
@ -113,27 +76,17 @@ openmanage__dep_packages:
# List of base packages to install.
#
openmanage__base_packages:
- 'libssl1.0.0'
- '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 [[[
#
# List of some packages specific to Debian Stretch (or Ubuntu Xenial)
# and previous versions.
#
# 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'
# ]]]
# .. envvar:: openmanage__webgui_state [[[
#
# What is the desired state for web interface of OMSA? Possible options:
@ -155,37 +108,6 @@ 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 [[[
# -----------------------------

View File

@ -1,17 +1,6 @@
---
# 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'

View File

@ -4,8 +4,6 @@ dependencies: []
galaxy_info:
author: "Jérémy Gardais"
namespace: ipr-cnrs
role_name: openmanage
description: "Setup Openmanage"
license: WTFPL
company: IPR
@ -14,8 +12,6 @@ galaxy_info:
platforms:
- name: Debian
versions:
- bullseye
- buster
- stretch
galaxy_tags:
- system

View File

@ -6,8 +6,8 @@
# 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) }}'
@ -20,7 +20,7 @@
## 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'
@ -33,12 +33,12 @@
## 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,106 +46,69 @@
# 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
- 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 }}'
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
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:
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']
when: (openmanage__deploy_state == "absent")
# 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"
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", "<="))))
when: (openmanage__deploy_state == "present")
## Manage symlinks for OpenManage/racadm apps
- name: Ensure some Executables are in PATH
ansible.builtin.file:
file:
src: "/opt/dell/srvadmin/sbin/{{ item }}"
path: "/bin/{{ item }}"
state: "link"
@ -158,7 +121,7 @@
when: (openmanage__deploy_state == "present")
- name: Remove Executables symlinks
ansible.builtin.file:
file:
path: "/bin/{{ item }}"
state: "absent"
with_items:

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