Create a specific user to launch `lmgrd`

This commit is contained in:
Jeremy Gardais 2018-02-23 15:27:53 +01:00
parent c83bd2decc
commit 1036d20858
4 changed files with 19 additions and 6 deletions

View File

@ -5,3 +5,4 @@
* Install FlexLM dependencies. * Install FlexLM dependencies.
* Copy `lmgrd` and `lmutil` binaries. * Copy `lmgrd` and `lmutil` binaries.
* Ensure to have a symlink for `lmgrd` to it's last version. * Ensure to have a symlink for `lmgrd` to it's last version.
* Create a specific user to launch `lmgrd`.

View File

@ -22,6 +22,7 @@ A role to manage Flexlm daemon.
* **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`].
* **flexlm__lmutil_path**: The place to store `lmutil` bin [default: `/usr/local/bin/lmutil`]. * **flexlm__lmutil_path**: The place to store `lmutil` bin [default: `/usr/local/bin/lmutil`].
* **flexlm__user_name**: Username used to launch `lmgrd` [default: `flexlm`].
## Example Playbook ## Example Playbook
@ -37,6 +38,7 @@ A role to manage Flexlm daemon.
This role will: This role will:
* Copy the `lmgrd` and `lmutil` binaries to the node. * Copy the `lmgrd` and `lmutil` binaries to the node.
* Create a specific user to launch daemon.
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**.

View File

@ -12,3 +12,6 @@ flexlm__lmgrd_source: 'usr/local/bin/lmgrd'
flexlm__lmgrd_path: '/usr/local/bin/lmgrd' flexlm__lmgrd_path: '/usr/local/bin/lmgrd'
flexlm__lmutil_source: 'usr/local/bin/lmutil' flexlm__lmutil_source: 'usr/local/bin/lmutil'
flexlm__lmutil_path: '/usr/local/bin/lmutil' flexlm__lmutil_path: '/usr/local/bin/lmutil'
# user
flexlm__user_name: 'flexlm'

View File

@ -13,29 +13,36 @@
# }}} # }}}
# user
- name: Create flexlm user
user:
name: '{{ flexlm__user_name }}'
createhome: False
system: True
# bin {{{ # bin {{{
- name: Add lmgrd bin - name: Add lmgrd bin
copy: 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: root owner: '{{ flexlm__user_name }}'
group: root group: '{{ flexlm__user_name }}'
mode: 0755 mode: 0755
- name: Link to the last version of lmgrd - name: Link to the last version of lmgrd
file: file:
src: '{{ flexlm__lmgrd_path + "." + flexlm__lmgrd_version }}' src: '{{ flexlm__lmgrd_path + "." + flexlm__lmgrd_version }}'
dest: '{{ flexlm__lmgrd_path }}' dest: '{{ flexlm__lmgrd_path }}'
owner: root owner: '{{ flexlm__user_name }}'
group: root group: '{{ flexlm__user_name }}'
state: link state: link
- name: Add lmutil bin - name: Add lmutil bin
copy: copy:
src: '{{ flexlm__lmutil_source }}' src: '{{ flexlm__lmutil_source }}'
dest: '{{ flexlm__lmutil_path }}' dest: '{{ flexlm__lmutil_path }}'
owner: root owner: '{{ flexlm__user_name }}'
group: root group: '{{ flexlm__user_name }}'
mode: 0755 mode: 0755
# }}} # }}}