uninstall.yml增加删除库表role.

This commit is contained in:
lijia
2020-04-07 15:43:40 +08:00
parent bbf5651c70
commit aca4de7ec3
4 changed files with 43 additions and 1 deletions

View File

@@ -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

View File

@@ -0,0 +1 @@
mysql -s -h $host -u $user -p$passwd $dbname < tsg_threshold.sql

View File

@@ -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`;

View File

@@ -59,4 +59,10 @@
- name: "uninstall oam_cli_agent_mxn"
yum:
name: "oam_cli_agent_mxn"
state: absent
state: absent
- hosts: sled-mcn0
gather_facts: no
roles:
- oam_env_cleanup