bachelor-thesis/infrastructure/ansible/roles/mft-codemeter/tasks/main.yml

33 lines
993 B
YAML

---
- name: Codemeter is started
service:
name: codemeter
state: restarted
- name: Start tixstream to find out if a new license has to be installed
command: "/opt/tixel/tixstream/bin/tixstream --check-license --license-type 380"
register: license_ok
ignore_errors: True
- name: Find CodeMeter license
local_action: find paths="{{ configs.deployment_dir }}" patterns="*.WibuCmRaU" file_type=file
become: false
register: all_codemeter_licenses
when: license_ok is failed
- name: Get latest CodeMeter license
set_fact:
codemeter_license: "{{ all_codemeter_licenses.files | sort(attribute='mtime',reverse=true) | first }}"
when: license_ok is failed
- name: copy license file
copy: src={{ codemeter_license.path }} dest={{ remote_deployment_dir }}
when: license_ok is failed
- name: Install license
shell: cmu -i -f {{ remote_deployment_dir }}/{{ codemeter_license.path | basename }}
when: license_ok is failed
ignore_errors: True
# vim:ft=ansible