This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tsg-tsg-os-buildimage/ansible/roles/hasp/tasks/main.yml
luwenpeng a844427fec TSG-15732 TSG-OS适配网络浮动许可证
1.更新aksusbd驱动,并禁用开机自启
    2.更新环境变量HASPUSER_PREFIX的目录,并添加到hasp_monitor.service中
    3.HASPUSER_PREFIX目录下增加默认配置文件hasp_25743.ini
        * 注释 Admin License Manager Server Address(部署时按需配置)
        * 默认禁用广播
    4.hasp_monitor.server只有在TSG-X设备上执行开机自启
2023-06-30 11:16:55 +00:00

86 lines
2.3 KiB
YAML

- name: "aksusbd rpm install: copy file to device"
copy:
src: '{{ role_path }}/files/aksusbd-8.31-1.x86_64.rpm'
dest: /tmp/ansible_deploy/
- name: "download rpm packages: hasp_tools"
yum:
name:
- "{{ hasp_tools_rpm_version.hasp_tools }}"
conf_file: "{{ rpm_repo_config_path }}"
state: present
download_only: yes
download_dir: "{{ path_download }}"
- name: "aksusbd rpm install: install aksusbd"
yum:
name:
- "/tmp/ansible_deploy/aksusbd-8.31-1.x86_64.rpm"
state: present
disable_gpg_check: yes
- name: "disable aksusbd.service"
systemd:
name: aksusbd.service
enabled: no
- name: "Get hasp_tools rpm path"
find:
path: /tmp/rpm_download/
pattern: "{{ hasp_tools_rpm_version.hasp_tools }}*"
register: hasp_tools_rpm_fullname
- name: "Install hasp_tools from local path"
yum:
name: "{{ hasp_tools_rpm_fullname.files[0].path }}"
state: present
disable_gpg_check: yes
- name: "replace action: replace service WantedBy from multi-user.target to workload.target"
replace:
path: "{{ item }}"
regexp: 'WantedBy=multi-user.target'
replace: 'WantedBy=workload.target'
with_items:
- /usr/lib/systemd/system/hasp_monitor.service
when: runtime_env != 'TSG-X-P0906'
- name: "Create /usr/lib/systemd/system/hasp_monitor.service.d/ directory if it does not exist"
file:
path: "{{ item }}"
state: directory
mode: '0755'
with_items:
- /usr/lib/systemd/system/hasp_monitor.service.d
- name: "copy env file to hasp_monitor.service.d"
copy:
src: "{{ role_path }}/templates/service_override_env.conf.j2"
dest: /usr/lib/systemd/system/hasp_monitor.service.d/service_override_env.conf
mode: 0644
- name: "Create /etc/haspuser/ directory if it does not exist"
file:
path: "{{ item }}"
state: directory
mode: '0755'
with_items:
- /etc/haspuser/
- name: "copy hasp_25743.ini to /etc/haspuser/"
copy:
src: "{{ role_path }}/files/hasp_25743.ini"
dest: /etc/haspuser/
mode: 0644
- name: "copy hasp.sh to /etc/profile.d/"
copy:
src: "{{ role_path }}/files/hasp.sh"
dest: /etc/profile.d/
mode: 0755
- name: "start hasp_monitor.service"
systemd:
name: hasp_monitor.service
enabled: yes
when: runtime_env == 'TSG-X-P0906'