--- # tasks file for flexlm # package {{{ - name: INSTALL FlexLM packages package: name: '{{ item }}' state: '{{ flexlm__packages_state }}' install_recommends: False with_flattened: - '{{ flexlm__dependent_packages }}' when: flexlm__packages_manage # }}} # user - name: Create flexlm user user: name: '{{ flexlm__user_name }}' createhome: False system: True # bin {{{ - name: Add lmgrd bin copy: src: '{{ flexlm__lmgrd_source + "." + flexlm__lmgrd_version }}' dest: '{{ flexlm__lmgrd_path + "." + flexlm__lmgrd_version }}' owner: '{{ flexlm__user_name }}' group: '{{ flexlm__user_name }}' mode: 0755 - name: Link to the last version of lmgrd file: src: '{{ flexlm__lmgrd_path + "." + flexlm__lmgrd_version }}' dest: '{{ flexlm__lmgrd_path }}' owner: '{{ flexlm__user_name }}' group: '{{ flexlm__user_name }}' state: link - name: Add lmutil bin copy: src: '{{ flexlm__lmutil_source }}' dest: '{{ flexlm__lmutil_path }}' owner: '{{ flexlm__user_name }}' group: '{{ flexlm__user_name }}' mode: 0755 # }}} # VENDOR and licence {{{ - 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()) - name: Add licence file copy: src: '{{ (item.lic_src | dirname) + "/" }}' # Need a final "/" dest: '{{ (item.lic_path | d("/opt/" + item.name + "/etc/licence.lic")) | dirname }}' owner: '{{ flexlm__user_name }}' group: '{{ flexlm__user_name }}' mode: 0640 with_flattened: - '{{ flexlm__licences }}' when: (item.lic_src|d()) # }}} # service {{{ - name: SERVICE '{{ flexlm__service_name }}' systemd unit template: src: '{{ flexlm__service_unit_content }}' dest: '{{ flexlm__service_unit_path }}' owner: 'root' group: 'root' mode: '0644' register: flexlm__register_systemd_service notify: ['restart flexlm service'] when: flexlm__service_manage - name: Reload systemd daemons command: systemctl daemon-reload notify: ['restart flexlm service'] when: (flexlm__service_manage and flexlm__register_systemd_service|changed) - name: SERVICE manage '{{ flexlm__service_name }}' service: name: '{{ flexlm__service_name }}' state: started enabled: '{{ flexlm__service_enabled }}' when: flexlm__service_manage # }}}