Add a way to provide vendor daemon for licences

This commit is contained in:
Jeremy Gardais 2018-02-27 08:32:20 +01:00
parent 3940d388f1
commit b4b3631f29
4 changed files with 47 additions and 3 deletions

View File

@ -1,4 +1,9 @@
## v1.x
### Features
* Add a way to provide vendor daemon for a licence.
## v1.0
### Features

View File

@ -24,6 +24,7 @@ A role to manage Flexlm daemon.
* **flexlm__lmutil_path**: The place to store `lmutil` bin [default: `/usr/local/bin/lmutil`].
* **flexlm__user_name**: Username used to launch `lmgrd` [default: `flexlm`].
* **flexlm__licence_file**: Licence file to deserve [default: `/opt/flexlm/VENDOR/licence.lic`].
* **flexlm__licences**: Lists to manage vendor daemon files [default: `[]`].
* **flexlm__service_manage**: If Licence Manager service should be managed with this role [default: `True`].
* **flexlm__service_enabled**: If Licence Manager service should be enable at startup [default: `True`].
* **flexlm__service_name**: Service name [default: `flexlm`].
@ -36,7 +37,7 @@ A role to manage Flexlm daemon.
* Manage Flexlm with defaults vars:
``` yml
``` yaml
- hosts: serverXYZ
roles:
- role: ipr-cnrs.flexlm
@ -44,21 +45,37 @@ A role to manage Flexlm daemon.
* Manage Flexlm to provide Intel Fortran:
``` yml
``` yaml
- hosts: intel-lm
croles:
roles:
- role: ipr-cnrs.flexlm
flexlm__service_working_directory: '/opt/intel/bin'
flexlm__licence_file: '/opt/intel/etc/license.lic'
flexlm__service_description: 'Licence Manager for Intel Fortran'
```
* Manage Flexlm to provide Matlab Licence and vendor daemon:
```yaml
- hosts: matlab-lm
roles:
- role: ipr-cnrs.flexlm
flexlm__service_working_directory: '/opt/matlab/bin'
flexlm__licence_file: '/opt/matlab/etc/license.lic'
flexlm__service_description: 'Licence Manager for Matlab'
flexlm__licences:
- name: matlab
bin_path: '/opt/matlab/bin'
bin_src: '{{ inventory_dir + "/../resources/service/matlab-lm/bin/" }}'
```
## Configuration
This role will:
* Copy the `lmgrd` and `lmutil` binaries to the client.
* Create a specific user to launch daemon.
* Set up a systemd service. [Thanks to Kalebo instructions][kalebo instruction flexlm systemd].
* Copy vendor daemon binaries to the host if specified.
The `lmgrd` and `lmutil` binaries comes from [Mathworks][mathworks download url] in version **flexlm__lmgrd_version**.

View File

@ -19,6 +19,14 @@ flexlm__user_name: 'flexlm'
# licence
flexlm__licence_file: '/opt/flexlm/VENDOR/licence.lic'
# Lists to manage vendor daemon.
# flexlm_licences:
# - name: matlab
# description: 'flexlm Licence Manager for Matlab'
# bin_path: '/opt/matlab/bin'
# bin_src: '{{ inventory_dir + "/../resources/service/matlab-lm/bin/" }}'
flexlm__licences: []
# service
flexlm__service_manage: True
flexlm__service_enabled: True

View File

@ -47,6 +47,20 @@
# }}}
# VENDOR {{{
- name: Add VENDOR DAEMON
copy:
src: '{{ item.bin_src }}'
dest: '{{ item.bin_path | d("/opt/" + item.name + "/bin") }}'
owner: '{{ flexlm__user_name }}'
group: '{{ flexlm__user_name }}'
mode: 0754
with_flattened:
- '{{ flexlm__licences }}'
when: (item.bin_src|d())
# }}}
# service {{{
- name: SERVICE '{{ flexlm__service_name }}' systemd unit