diff options
| author | zhangzhihan <[email protected]> | 2020-06-01 12:19:54 +0800 |
|---|---|---|
| committer | zhangzhihan <[email protected]> | 2020-06-01 12:19:54 +0800 |
| commit | a31ac9eb7dc33d22f25cff07450635126880a426 (patch) | |
| tree | e7d18f4f8fe95d62d464b3819075298000924c29 /roles/setup_mariadb/tasks | |
| parent | cf3847561290b69ccb3fed53a130bee15b7b6d1a (diff) | |
Diffstat (limited to 'roles/setup_mariadb/tasks')
| -rw-r--r-- | roles/setup_mariadb/tasks/main.yml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/roles/setup_mariadb/tasks/main.yml b/roles/setup_mariadb/tasks/main.yml new file mode 100644 index 0000000..4ecbb61 --- /dev/null +++ b/roles/setup_mariadb/tasks/main.yml @@ -0,0 +1,17 @@ +- name: "judge tsg_oam" + shell: mysql -uroot -p111111 -e "show databases;" |grep tsg_oam + register: return + ignore_errors: true + +- name: "set tsg_oam database" + shell: mysql -uroot -p{{ mariadb.password }} -e "create database tsg_oam" + when: return.rc != 0 + +- name: "Templates tsg_threshold.sql" + template: + src: "{{role_path}}/templates/tsg_threshold.sql.j2" + dest: /tmp/tsg-cli-deploy/tsg_threshold.sql + tags: template + +- name: "import the sql after template" + shell: mysql -s -h 127.0.0.1 -u {{ mariadb.username }} -p{{ mariadb.password }} < /tmp/tsg-cli-deploy/tsg_threshold.sql |
