Compare commits

..

20 Commits

Author SHA1 Message Date
Jeremy Gardais 659b2b04ac
Update domain for git.ipr 2023-11-03 16:06:45 +01:00
Jeremy Gardais f71f77d10a
Prefix module with "ansible.builtin." 2023-01-24 11:40:23 +01:00
Jeremy Gardais edd21486f8
Use flatten to manage packages list 2023-01-24 11:34:35 +01:00
Jeremy Gardais c0a911d5df
Role works with Debian Bullseye 2022-03-24 17:12:57 +01:00
Jeremy Gardais c089beb8fe
Remove old 11.14.0 version of lmgrd 2022-03-24 16:50:11 +01:00
Jeremy Gardais 51adb58540
Upgrade lmgrd and lmutil daemon to version 11.18.1 2022-03-24 16:47:40 +01:00
Jeremy Gardais 8a8a9ddd72 Debian Buster support 2020-05-07 11:24:24 +02:00
Jeremy Gardais 1ee35d9ea4 Ensure lib64 ld-linux symlinks exists 2020-05-07 11:23:13 +02:00
Jeremy Gardais 424dc5d8ee Empty requirements packages by default 2020-05-06 17:20:14 +02:00
Jeremy Gardais 212ea834b5 Ensure to install requirements on Debian Stretch 2020-05-06 17:18:34 +02:00
Jeremy Gardais 46422ee402 Publish version 2.1.4 2019-10-08 10:22:20 +02:00
Jeremy Gardais 6952eeeb16 Upgrade lmgrd and lmutil binaries to 11.16.2.1 2019-10-08 10:16:04 +02:00
Jeremy Gardais bc33b60bda
Use to_nice_json to manage packages list 2019-02-27 11:49:10 +01:00
Jeremy Gardais 9c8c181e70
Fix E503 Task that run when changed should likely be handlers
Daemon_reload moved to handlers file.
2019-02-26 17:30:43 +01:00
Jeremy Gardais f85fd58bad
Fix E303 systemctl used in place of systemd module 2019-02-26 14:05:37 +01:00
Jeremy Gardais 67b3cbc635
Fix E405 Remote package tasks should have a retry 2019-02-26 14:00:11 +01:00
Jeremy Gardais fbb6814ce8
Set empty dependencies line to fix Galaxy warning 2018-08-06 15:25:43 +02:00
Jeremy Gardais c6e53f30d9
Fix some minor warnings from ansible-lint 2018-08-06 15:25:03 +02:00
Jeremy Gardais f7f230589b Create a symlink (/usr/tmp) to /tmp to avoid error
fix #2 .
2018-02-28 15:04:06 +01:00
Jeremy Gardais a8a6192cdc Add a missing ")" in the handler 2018-02-28 14:43:40 +01:00
13 changed files with 116 additions and 30 deletions

View File

@ -1,3 +1,52 @@
## v2.3.2
### Fix
* Use flatten to manage packages list.
* Prefix module with "ansible.builtin.".
## v2.3.1
### Enhancements
* Works with Debian Bullseye.
## v2.3.0
### Enhancements
* Upgrade lmgrd and lmutil daemon to version 11.18.1.
* Remove old 11.14.0 version of lmgrd.
## v2.2.0
### Enhancements
* Ensure to install requirements on Debian Stretch.
* Empty requirements packages by default cause `lsb-compat` is no longer available on Debian Buster.
* Ensure lib64 ld-linux symlinks exists.
* Now works with Debian Buster.
## v2.1.4
### Enhancements
* Upgrade lmgrd and lmutil daemon to version 11.16.2.1.
## v2.1.3
### Enhancements
* Use to_nice_json to manage packages list.
## v2.1.2
* Fix E405 Remote package tasks should have a retry.
* Fix E303 systemctl used in place of systemd module.
* Fix E503 Tasks that run when changed should likely be handlers. Daemon_reload moved to handlers file.
## v2.1.1
### Fixes
* Fix some warnings from ansible-lint.
* Set empty dependencies line to fix Galaxy warning.
## v2.1
### Fixes
* Add a missing ")" in the handler.
* Create a symlink (/usr/tmp) to /tmp to avoid error (fix #2).
## v2.0 ## v2.0

View File

@ -15,9 +15,9 @@ A role to manage Flexlm daemon and licence/binaries files.
## Role Variables ## Role Variables
* **flexlm__required_packages**: List of required packages requested as 'flexlm' dependencies [default: `lsb-core`] * **flexlm__required_packages**: List of required packages requested as 'flexlm' dependencies [default: `[]`]
* **flexlm__deploy_state**: The desired state this role should achieve. [default: `present`]. * **flexlm__deploy_state**: The desired state this role should achieve. [default: `present`].
* **flexlm__lmgrd_version**: Version of `lmgrd` to use [default: `11.14.0.1`]. * **flexlm__lmgrd_version**: Version of `lmgrd` to use [default: `11.18.1`].
* **flexlm__lmgrd_source**: Source of the `lmgrd` bin to send [default: `usr/local/bin/lmgrd`]. * **flexlm__lmgrd_source**: Source of the `lmgrd` bin to send [default: `usr/local/bin/lmgrd`].
* **flexlm__lmgrd_path**: The place to store `lmgrd` bin [default: `/usr/local/bin/lmgrd`]. * **flexlm__lmgrd_path**: The place to store `lmgrd` bin [default: `/usr/local/bin/lmgrd`].
* **flexlm__lmutil_source**: Source of the `lmutil` bin to send [default: `usr/local/bin/lmutil`]. * **flexlm__lmutil_source**: Source of the `lmutil` bin to send [default: `usr/local/bin/lmutil`].
@ -64,6 +64,8 @@ This role will:
* Set up a systemd service (flexlm-item.name). [Thanks to Kalebo instructions][kalebo instruction flexlm systemd]. * Set up a systemd service (flexlm-item.name). [Thanks to Kalebo instructions][kalebo instruction flexlm systemd].
* Copy vendor daemon binaries to the host if source is specified. * Copy vendor daemon binaries to the host if source is specified.
* Copy licence file to the host if source is specified. * Copy licence file to the host if source is specified.
* Create a symlink (/usr/tmp) to /tmp to avoid error.
* Create a symlinks to ld-linux librairies.
The `lmgrd` and `lmutil` binaries comes from [Mathworks][mathworks download url] in version **flexlm__lmgrd_version**. The `lmgrd` and `lmutil` binaries comes from [Mathworks][mathworks download url] in version **flexlm__lmgrd_version**.
@ -90,7 +92,7 @@ Jérémy Gardais
* [IPR][ipr website] (Institut de Physique de Rennes) * [IPR][ipr website] (Institut de Physique de Rennes)
[gogs to github hook]: https://stackoverflow.com/a/21998477 [gogs to github hook]: https://stackoverflow.com/a/21998477
[flexlm source]: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.flexlm [flexlm source]: https://git.ipr.univ-rennes.fr/cellinfo/ansible.flexlm
[flexlm github]: https://github.com/ipr-cnrs/flexlm [flexlm github]: https://github.com/ipr-cnrs/flexlm
[wtfpl website]: http://www.wtfpl.net/about/ [wtfpl website]: http://www.wtfpl.net/about/
[ipr website]: https://ipr.univ-rennes1.fr/ [ipr website]: https://ipr.univ-rennes1.fr/

View File

@ -10,8 +10,7 @@
# .. envvar:: flexlm__base_packages [[[ # .. envvar:: flexlm__base_packages [[[
# #
# List of base packages to install. # List of base packages to install.
flexlm__required_packages: flexlm__required_packages: []
- 'lsb-core'
# ]]] # ]]]
# .. envvar:: flexlm__deploy_state [[[ # .. envvar:: flexlm__deploy_state [[[
# #
@ -36,7 +35,7 @@ flexlm__deploy_state: 'present'
# #
# A symlink will be create to ``lmgrd`` daemon to have a simpler name. # A symlink will be create to ``lmgrd`` daemon to have a simpler name.
# #
flexlm__lmgrd_version: '11.14.0.1' flexlm__lmgrd_version: '11.18.1'
# ]]] # ]]]
# .. envvar:: flexlm__lmgrd_path [[[ # .. envvar:: flexlm__lmgrd_path [[[

Binary file not shown.

Binary file not shown.

BIN
files/usr/local/bin/lmgrd.11.18.1 Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3,8 +3,11 @@
- name: restart flexlm services - name: restart flexlm services
service: service:
name: '{{ "flexlm-" + item.name }}' name: '{{ "flexlm-" + item.name }}'
state: '{{ "restarted" if (flexlm__deploy_state == "present" and (item.service | d(True) | bool) else "stopped" }}' state: '{{ "restarted" if (flexlm__deploy_state == "present" and (item.service | d(True) | bool)) else "stopped" }}'
enabled: '{{ item.service | d(True) | bool }}' enabled: '{{ item.service | d(True) | bool }}'
with_flattened: with_flattened:
- '{{ flexlm__licences }}' - '{{ flexlm__licences }}'
- name: systemd daemon reload
systemd:
daemon_reload: True

View File

@ -1,14 +1,19 @@
---
dependencies: []
galaxy_info: galaxy_info:
author: "Jérémy Gardais" author: "Jérémy Gardais"
description: "Manage FlexLM daemon" description: "Manage FlexLM daemon"
license: WTFPL license: WTFPL
company: IPR company: IPR
issue_tracker_url: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.flexlm/issues issue_tracker_url: https://git.ipr.univ-rennes.fr/cellinfo/ansible.flexlm/issues
min_ansible_version: 2.4 min_ansible_version: 2.9
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- stretch - bullseye
- buster
galaxy_tags: galaxy_tags:
- system - system
- flexlm - flexlm

View File

@ -3,25 +3,54 @@
# #
# tasks file for flexlm # tasks file for flexlm
# Load vars [[[1
- name: Load specific OS vars
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution|lower }}.yml"
- "{{ ansible_os_family|lower }}.yml"
skip: true
# Manage required system packages [[[1 # Manage required system packages [[[1
- name: Ensure required packages are in there desired state - name: Ensure required packages are in there desired state
package: ansible.builtin.package:
name: '{{ item }}' name: '{{ flexlm__required_packages | flatten }}'
state: '{{ "present" if (flexlm__deploy_state == "present") else "absent" }}' state: '{{ "present" if (flexlm__deploy_state == "present") else "absent" }}'
install_recommends: False install_recommends: False
with_flattened: register: flexlm_pkg_result
- '{{ flexlm__required_packages }}' until: flexlm_pkg_result is success
# user # user
- name: Create flexlm user - name: Create flexlm user
user: ansible.builtin.user:
name: '{{ flexlm__user_name }}' name: '{{ flexlm__user_name }}'
createhome: False createhome: False
system: True system: True
# Create a symlink for /tmp [[[1
- name: Symlink /usr/tmp
ansible.builtin.file:
src: /tmp
dest: /usr/tmp
state: link
# Create a symlink for libs [[[1
- name: Symlinks to /lib64/ld-linux-x86-64.so.2
ansible.builtin.file:
src: /lib64/ld-linux-x86-64.so.2
dest: '{{ item }}'
state: link
with_items:
- /lib64/ld-lsb-x86-64.so.2
- /lib64/ld-lsb-x86-64.so.3
# lmgrd and lmutil binaries [[[1 # lmgrd and lmutil binaries [[[1
- name: Add lmgrd bin - name: Add lmgrd bin
copy: ansible.builtin.copy:
src: '{{ flexlm__lmgrd_source + "." + flexlm__lmgrd_version }}' src: '{{ flexlm__lmgrd_source + "." + flexlm__lmgrd_version }}'
dest: '{{ flexlm__lmgrd_path + "." + flexlm__lmgrd_version }}' dest: '{{ flexlm__lmgrd_path + "." + flexlm__lmgrd_version }}'
owner: '{{ flexlm__user_name }}' owner: '{{ flexlm__user_name }}'
@ -29,7 +58,7 @@
mode: 0755 mode: 0755
- name: Link to the last version of lmgrd - name: Link to the last version of lmgrd
file: ansible.builtin.file:
src: '{{ flexlm__lmgrd_path + "." + flexlm__lmgrd_version }}' src: '{{ flexlm__lmgrd_path + "." + flexlm__lmgrd_version }}'
dest: '{{ flexlm__lmgrd_path }}' dest: '{{ flexlm__lmgrd_path }}'
owner: '{{ flexlm__user_name }}' owner: '{{ flexlm__user_name }}'
@ -37,7 +66,7 @@
state: link state: link
- name: Add lmutil bin - name: Add lmutil bin
copy: ansible.builtin.copy:
src: '{{ flexlm__lmutil_source }}' src: '{{ flexlm__lmutil_source }}'
dest: '{{ flexlm__lmutil_path }}' dest: '{{ flexlm__lmutil_path }}'
owner: '{{ flexlm__user_name }}' owner: '{{ flexlm__user_name }}'
@ -46,7 +75,7 @@
# VENDOR and licence [[[1 # VENDOR and licence [[[1
- name: Add VENDOR DAEMON - name: Add VENDOR DAEMON
copy: ansible.builtin.copy:
src: '{{ item.bin_src }}' src: '{{ item.bin_src }}'
dest: '{{ item.bin_path | d("/opt/" + item.name + "/bin") }}' dest: '{{ item.bin_path | d("/opt/" + item.name + "/bin") }}'
owner: '{{ flexlm__user_name }}' owner: '{{ flexlm__user_name }}'
@ -58,7 +87,7 @@
notify: ['restart flexlm services'] notify: ['restart flexlm services']
- name: Add licence file - name: Add licence file
copy: ansible.builtin.copy:
src: '{{ (item.lic_src | dirname) + "/" }}' # Need a final "/" src: '{{ (item.lic_src | dirname) + "/" }}' # Need a final "/"
dest: '{{ (item.lic_path | d("/opt/" + item.name + "/etc/licence.lic")) | dirname }}' dest: '{{ (item.lic_path | d("/opt/" + item.name + "/etc/licence.lic")) | dirname }}'
owner: '{{ flexlm__user_name }}' owner: '{{ flexlm__user_name }}'
@ -72,28 +101,22 @@
# Manage services [[[1 # Manage services [[[1
- name: Add systemd unit - name: Add systemd unit
template: ansible.builtin.template:
src: '{{ flexlm__service_unit_content }}' src: '{{ flexlm__service_unit_content }}'
dest: '{{ "/etc/systemd/system/flexlm-" + item.name + ".service" }}' dest: '{{ "/etc/systemd/system/flexlm-" + item.name + ".service" }}'
owner: 'root' owner: 'root'
group: 'root' group: 'root'
mode: '0644' mode: '0644'
register: flexlm__register_service
with_flattened: with_flattened:
- '{{ flexlm__licences }}' - '{{ flexlm__licences }}'
when: ( (flexlm__deploy_state == "present") and when: ( (flexlm__deploy_state == "present") and
( item.service | d(True) )) ( item.service | d(True) ))
notify: ['systemd daemon reload', 'restart flexlm services']
- name: Reload systemd daemons
command: systemctl daemon-reload
notify: ['restart flexlm services']
when: ( flexlm__register_service|changed )
- name: Manage flexlm services - name: Manage flexlm services
service: ansible.builtin.service:
name: '{{ "flexlm-" + item.name }}' name: '{{ "flexlm-" + item.name }}'
state: '{{ "started" if (flexlm__deploy_state == "present" and (item.service | d(True) | bool)) else "stopped" }}' state: '{{ "started" if (flexlm__deploy_state == "present" and (item.service | d(True) | bool)) else "stopped" }}'
enabled: '{{ item.service | d(True) | bool }}' enabled: '{{ item.service | d(True) | bool }}'
with_flattened: with_flattened:
- '{{ flexlm__licences }}' - '{{ flexlm__licences }}'

5
vars/debian-stretch.yml Normal file
View File

@ -0,0 +1,5 @@
---
# Specific vars for Debian Stretch
flexlm__required_packages:
- 'lsb-compat'