117 lines
3.1 KiB
YAML
117 lines
3.1 KiB
YAML
---
|
|
- name: "copy tfe program to destination server"
|
|
copy:
|
|
src: "{{ role_path }}/files/"
|
|
dest: /tmp/ansible_deploy/
|
|
|
|
- name: "copy tfe.service to destination server"
|
|
copy:
|
|
src: "{{ role_path }}/files/tfe.service"
|
|
dest: /usr/lib/systemd/system/
|
|
mode: 0644
|
|
|
|
- name: "Get tfe rpm final version"
|
|
set_fact:
|
|
tfe_rpm_final_version: "{{ item.value }}"
|
|
when: item.key is search("tfe")
|
|
with_dict: "{{ tfe_rpm_version }}"
|
|
|
|
- name: "Get tfe rpm path"
|
|
find:
|
|
path: /tmp/rpm_download/
|
|
pattern: "{{ tfe_rpm_final_version }}*"
|
|
register: tfe_rpm_fullname
|
|
|
|
- name: "Install tfe from local path"
|
|
yum:
|
|
name: "{{ tfe_rpm_fullname.files[0].path }}"
|
|
state: present
|
|
|
|
- name: "tfe:copy cert file to device"
|
|
copy:
|
|
src: '{{ role_path }}/files/tsg_diagnose_ca.pem'
|
|
dest: /opt/tsg/tfe/resource/tfe/
|
|
|
|
- name: "template tfe-env config"
|
|
template:
|
|
src: "{{ role_path }}/templates/tfe-env-config.j2"
|
|
dest: /etc/sysconfig/tfe-env-config
|
|
|
|
- name: "template the tfe.conf"
|
|
template:
|
|
src: "{{ role_path }}/templates/tfe.conf.j2.j2"
|
|
dest: /opt/tsg/tsg-os-provision/templates/tfe.conf.j2
|
|
|
|
- name: "template the zlog.conf"
|
|
template:
|
|
src: "{{ role_path }}/templates/zlog.conf.j2"
|
|
dest: /opt/tsg/tfe/conf/tfe/zlog.conf
|
|
|
|
- name: "template the future.conf"
|
|
template:
|
|
src: "{{ role_path }}/templates/future.conf.j2"
|
|
dest: /opt/tsg/tfe/conf/tfe/future.conf
|
|
|
|
- name: "template the pangu_pxy.conf"
|
|
template:
|
|
src: "{{ role_path }}/templates/pangu_pxy.conf.j2.j2"
|
|
dest: /opt/tsg/tsg-os-provision/templates/pangu_pxy.conf.j2
|
|
|
|
- name: "create conf/doh/"
|
|
file:
|
|
path: /opt/tsg/tfe/conf/doh/
|
|
state: directory
|
|
|
|
- name: "template the doh.conf"
|
|
template:
|
|
src: "{{ role_path }}/templates/doh.conf.j2"
|
|
dest: /opt/tsg/tfe/conf/doh/doh.conf
|
|
|
|
- name: "create a override conf - first step, create dir"
|
|
file:
|
|
path: /usr/lib/systemd/system/tfe.service.d/
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: "create a override conf - second step, copy a override service file"
|
|
template:
|
|
src: "{{ role_path }}/templates/require-mrzcpd.conf.j2"
|
|
dest: /usr/lib/systemd/system/tfe.service.d/require-mrzcpd.conf
|
|
|
|
- name: "copy slice file to tfe.service.d"
|
|
copy:
|
|
src: "{{ role_path }}/templates/service_override_slice.conf.j2"
|
|
dest: /usr/lib/systemd/system/tfe.service.d/service_override_slice.conf
|
|
mode: 0644
|
|
|
|
- name: "copy env file to tfe.service.d"
|
|
copy:
|
|
src: "{{ role_path }}/templates/service_override_env.conf.j2"
|
|
dest: /usr/lib/systemd/system/tfe.service.d/service_override_env.conf
|
|
mode: 0644
|
|
|
|
- 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/tfe-env.service
|
|
- /usr/lib/systemd/system/tfe.service
|
|
|
|
##################### tfe #####################
|
|
- name: "systemctl daemon-reload"
|
|
systemd:
|
|
daemon_reload: yes
|
|
when: runtime_env == 'TSG-server'
|
|
|
|
- name: "enable tfe-env"
|
|
systemd:
|
|
name: tfe-env
|
|
enabled: yes
|
|
|
|
- name: "enable tfe"
|
|
systemd:
|
|
name: tfe
|
|
enabled: yes
|