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
zhangzhihan-device-manageme…/roles/tsg-cli-mxn/tasks/main.yml
zhangzhihan 465622889c update 20.11
2020-11-12 22:56:55 +06:00

105 lines
2.7 KiB
YAML

---
#- name: "copy tsg_read_sn.sh to destination server"
# copy:
# src: "{{ role_path }}/files/tsg_read_sn.sh"
# dest: "/tmp/tsg-cli-deploy/"
# mode: 0755
# when: use_chassis_hardware_sn | bool
#
#- name: "copy cmm_api_tst to destination server"
# copy:
# src: "{{ role_path }}/files/cmm_api_tst"
# dest: "/tmp/tsg-cli-deploy/"
# mode: 0755
# when: use_chassis_hardware_sn | bool
#
#- name: "run tsg_read_sn.sh on destination server"
# shell: ./tsg_read_sn.sh
# args:
# chdir: /tmp/tsg-cli-deploy/
# when: use_chassis_hardware_sn | bool
#
#- name: "scp tsg_sn.json from destination server to local"
# fetch:
# src: "/tmp/tsg-cli-deploy/tsg_sn.json"
# dest: "{{ role_path }}/../tsg-common-files/tsg_sn.json"
# flat: yes
# when: use_chassis_hardware_sn | bool
- name: "copy tsg-cli rpm to destination server"
synchronize:
src: "{{ role_path }}/../tsg-common-files/{{ tsg_cli.rpm_file_name }}"
dest: "/tmp/tsg-cli-deploy/"
- name: "install tsg-cli"
yum:
name: "{{ packages }}"
state: present
vars:
packages:
- /tmp/tsg-cli-deploy/{{ tsg_cli.rpm_file_name }}
- name: "create /opt/tsg/etc/"
file:
path: /opt/tsg/etc
state: directory
- name: Template the tsg_sn.json
template:
src: "{{ role_path }}/templates/tsg_sn.json.j2"
dest: "/opt/tsg/etc/tsg_sn.json"
tags: template
- name: Template the tsg_cli_env.ini.j2
template:
src: "{{ role_path }}/templates/tsg_cli_env.ini.j2"
dest: /opt/tsg/etc/tsg_cli_env.ini
tags: template
- name: Template the tsg_tags.json
template:
src: "{{ role_path }}/../tsg-common-files/tsg_tags.json.j2"
dest: "/opt/tsg/etc/tsg_tags.json"
tags: template
- name: Template the tsg_device_tag.json
template:
src: "{{ role_path }}/../tsg-common-files/tsg_device_tag.json.j2"
dest: "/opt/tsg/etc/tsg_device_tag.json"
tags: template
- name: Template the tsg_series.json
template:
src: "{{ role_path }}/templates/tsg_series.json.j2"
dest: "/opt/tsg/etc/tsg_series.json"
tags: template
- name: "copy tsg-monitor.service to destination server"
synchronize:
src: "{{ role_path }}/files/tsg-monitor.service"
dest: "/usr/lib/systemd/system"
- name: "copy tsg-monitor.sh to destination server"
copy:
src: "{{ role_path }}/files/tsg-monitor.sh"
dest: "/opt/tsg/tsg-monitor/"
mode: 0755
- name: "copy rsyslog.conf to destination server"
synchronize:
src: "{{ role_path }}/files/rsyslog.conf"
dest: "/etc/"
- name: "restart rsyslog service"
systemd:
name: rsyslog
state: restarted
- name: "enable tsg-monitor service"
systemd:
name: tsg-monitor
enabled: yes
daemon_reload: yes
state: restarted