修改了一些bug,因涉及文件较大,使用ansible增量更新文件,而不是手工pscp,pssh方式.
This commit is contained in:
31
20201121_inc_update.yml
Normal file
31
20201121_inc_update.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
- hosts: blade-mxn
|
||||||
|
roles:
|
||||||
|
- tsg-cli-mxn
|
||||||
|
- oam_cli_agent_mxn
|
||||||
|
- oam_core
|
||||||
|
|
||||||
|
- hosts: blade-mcn0
|
||||||
|
roles:
|
||||||
|
- tsg-cli-mcn0
|
||||||
|
- setup_mariadb
|
||||||
|
- oam_cli_agent
|
||||||
|
|
||||||
|
- hosts: blade-mcn1
|
||||||
|
roles:
|
||||||
|
- tsg-cli-mcn1
|
||||||
|
- oam_cli_agent
|
||||||
|
|
||||||
|
- hosts: blade-mcn2
|
||||||
|
roles:
|
||||||
|
- tsg-cli-mcn2
|
||||||
|
- oam_cli_agent
|
||||||
|
|
||||||
|
- hosts: blade-mcn3
|
||||||
|
roles:
|
||||||
|
- tsg-cli-mcn3
|
||||||
|
- oam_cli_agent
|
||||||
|
|
||||||
|
- hosts: blade-mxn
|
||||||
|
roles:
|
||||||
|
- oam_mxn_start
|
||||||
|
|
||||||
@@ -1,40 +1,9 @@
|
|||||||
- name: "copy oam_cli_agent.rpm to destination server"
|
|
||||||
copy:
|
|
||||||
src: "{{ role_path }}/files/"
|
|
||||||
dest: /tmp
|
|
||||||
|
|
||||||
- name: "install oam_cli_agent"
|
|
||||||
yum:
|
|
||||||
name:
|
|
||||||
- /tmp/oam_cli_agent-1.0-1.0.x86_64.rpm
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: "bak snmpd.conf"
|
|
||||||
shell: cp -rf /usr/share/snmp/snmpd.conf /usr/share/snmp/snmpd.conf_origin
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: "Templates snmpd.conf"
|
|
||||||
template:
|
|
||||||
src: "{{role_path}}/templates/snmpd.conf"
|
|
||||||
dest: /usr/share/snmp/snmpd.conf
|
|
||||||
tags: template
|
|
||||||
|
|
||||||
- name: "Templates oam_cli_agent.service"
|
- name: "Templates oam_cli_agent.service"
|
||||||
template:
|
template:
|
||||||
src: "{{ role_path }}/templates/oam_cli_agent.service.j2"
|
src: "{{ role_path }}/templates/oam_cli_agent.service.j2"
|
||||||
dest: /usr/lib/systemd/system/oam_cli_agent.service
|
dest: /usr/lib/systemd/system/oam_cli_agent.service
|
||||||
|
|
||||||
- name: "Templates application.properties.j2"
|
|
||||||
template:
|
|
||||||
src: "{{ role_path }}/templates/application.properties.j2"
|
|
||||||
dest: /opt/tsg/cli_agent/application.properties
|
|
||||||
|
|
||||||
- name: "Start snmpd"
|
|
||||||
systemd:
|
|
||||||
name: snmpd
|
|
||||||
state: restarted
|
|
||||||
enabled: yes
|
|
||||||
|
|
||||||
- name: "Start oam_cli_agent"
|
- name: "Start oam_cli_agent"
|
||||||
systemd:
|
systemd:
|
||||||
name: oam_cli_agent
|
name: oam_cli_agent
|
||||||
|
|||||||
@@ -1,27 +1,13 @@
|
|||||||
- name: "copy oam_cli_agent_mxn.rpm to destination server"
|
|
||||||
copy:
|
|
||||||
src: "{{ role_path }}/files/"
|
|
||||||
dest: /tmp
|
|
||||||
|
|
||||||
- name: "install oam_cli_agent_mxn"
|
|
||||||
yum:
|
|
||||||
name:
|
|
||||||
- /tmp/oam_cli_agent_mxn-1.0-1.0.x86_64.rpm
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: "Templates oam_cli_agent_mxn.service"
|
- name: "Templates oam_cli_agent_mxn.service"
|
||||||
template:
|
template:
|
||||||
src: "{{ role_path }}/templates/oam_cli_agent_mxn.service.j2"
|
src: "{{ role_path }}/templates/oam_cli_agent_mxn.service.j2"
|
||||||
dest: /usr/lib/systemd/system/oam_cli_agent_mxn.service
|
dest: /usr/lib/systemd/system/oam_cli_agent_mxn.service
|
||||||
|
|
||||||
- name: "Templates application.properties.j2"
|
|
||||||
template:
|
|
||||||
src: "{{ role_path }}/templates/application.properties.j2"
|
|
||||||
dest: /opt/tsg/cli_agent/application.properties
|
|
||||||
|
|
||||||
#- name: "Start oam_cli_agent_mxn"
|
- name: "Start oam_cli_agent_mxn"
|
||||||
# systemd:
|
systemd:
|
||||||
# name: oam_cli_agent_mxn
|
name: oam_cli_agent_mxn
|
||||||
# state: restarted
|
state: restarted
|
||||||
# enabled: yes
|
enabled: yes
|
||||||
# daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|||||||
79
uninstall.yml
Normal file
79
uninstall.yml
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
---
|
||||||
|
- hosts: blade-mxn
|
||||||
|
tasks:
|
||||||
|
- name: "stop oam_core.service"
|
||||||
|
service:
|
||||||
|
name: oam_core
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: "stop oam_snmp service"
|
||||||
|
service:
|
||||||
|
name: oam_snmp
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: "stop oam_cli service"
|
||||||
|
service:
|
||||||
|
name: oam_cli
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: "stop oam_cli_agent_mxn service"
|
||||||
|
service:
|
||||||
|
name: oam_cli_agent_mxn
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: "stop consul-server-external service"
|
||||||
|
service:
|
||||||
|
name: consul-server-external
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
|
||||||
|
- name: "uninstall oam_core"
|
||||||
|
yum:
|
||||||
|
name: "oam_core"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: "uninstall oam_cli"
|
||||||
|
yum:
|
||||||
|
name: "oam_cli"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: "uninstall oam_snmp"
|
||||||
|
yum:
|
||||||
|
name: "oam_snmp"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: "uninstall oam_cli_agent_mxn"
|
||||||
|
yum:
|
||||||
|
name: "oam_cli_agent_mxn"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
|
||||||
|
- name: "uninstall tsg-cli"
|
||||||
|
yum:
|
||||||
|
name: "tsg-cli"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
|
||||||
|
- hosts: all
|
||||||
|
tasks:
|
||||||
|
- name: "stop tsg-monitor service"
|
||||||
|
service:
|
||||||
|
name: tsg-monitor
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: "uninstall tsg-cli"
|
||||||
|
yum:
|
||||||
|
name: "tsg-cli"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: "uninstall oam_cli_agent"
|
||||||
|
yum:
|
||||||
|
name: "oam_cli_agent"
|
||||||
|
state: absent
|
||||||
|
|
||||||
13
uninstall_oam_core.yml
Normal file
13
uninstall_oam_core.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
- hosts: blade-mxn
|
||||||
|
tasks:
|
||||||
|
- name: "stop oam_core.service"
|
||||||
|
service:
|
||||||
|
name: oam_core
|
||||||
|
state: stopped
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: "uninstall oam_core"
|
||||||
|
yum:
|
||||||
|
name: "oam_core"
|
||||||
|
state: absent
|
||||||
Reference in New Issue
Block a user