diff --git a/roles/oam_env_cleanup/tasks/main.yml b/roles/oam_env_cleanup/tasks/main.yml new file mode 100644 index 0000000..ee8a5d1 --- /dev/null +++ b/roles/oam_env_cleanup/tasks/main.yml @@ -0,0 +1,12 @@ +--- + +- name: "Templates tsg_threshold.sql" + template: + src: "{{role_path}}/templates/tsg_threshold_cleanup.sql.j2" + dest: /tmp/tsg_threshold_cleanup.sql + tags: cleanup + + +- name: "import the sql after template" + shell: mysql -s -h 127.0.0.1 -u {{ mariadb.username }} -p{{ mariadb.password }} < /tmp/tsg_threshold_cleanup.sql + tags: cleanup \ No newline at end of file diff --git a/roles/oam_env_cleanup/templates/sql.txt b/roles/oam_env_cleanup/templates/sql.txt new file mode 100644 index 0000000..234f528 --- /dev/null +++ b/roles/oam_env_cleanup/templates/sql.txt @@ -0,0 +1 @@ +mysql -s -h $host -u $user -p$passwd $dbname < tsg_threshold.sql \ No newline at end of file diff --git a/roles/oam_env_cleanup/templates/tsg_threshold_cleanup.sql.j2 b/roles/oam_env_cleanup/templates/tsg_threshold_cleanup.sql.j2 new file mode 100644 index 0000000..c7cd564 --- /dev/null +++ b/roles/oam_env_cleanup/templates/tsg_threshold_cleanup.sql.j2 @@ -0,0 +1,23 @@ +/* +Navicat MySQL Data Transfer + +Source Server : localhost +Source Server Version : 50713 +Source Host : localhost:3306 +Source Database : alt + +Target Server Type : MYSQL +Target Server Version : 50713 +File Encoding : 65001 + +Date: 2020-01-21 17:33:00 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +use tsg_oam; + +-- ---------------------------- +-- Table structure for `tsg_threshold` +-- ---------------------------- +DROP TABLE IF EXISTS `tsg_threshold`; \ No newline at end of file diff --git a/uninstall_oam_for_40.170.yml b/uninstall_oam_for_40.170.yml index 8c7b8e9..a437d2a 100644 --- a/uninstall_oam_for_40.170.yml +++ b/uninstall_oam_for_40.170.yml @@ -59,4 +59,10 @@ - name: "uninstall oam_cli_agent_mxn" yum: name: "oam_cli_agent_mxn" - state: absent \ No newline at end of file + state: absent + +- hosts: sled-mcn0 + gather_facts: no + roles: + - oam_env_cleanup + \ No newline at end of file