You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hetzner-ansible/roles/import-maria-database/tasks/main.yml

43 lines
1.2 KiB
YAML

---
- name: "Send mattermost message"
uri:
url: "{{ mattermost_hook_smardigo }}"
method: POST
body: "{{ lookup('template','mattermost-deploy-start.json.j2') }}"
body_format: json
headers:
Content-Type: "application/json"
delegate_to: 127.0.0.1
become: false
when:
- send_status_messages # TODO: Message Refactor :')
- name: "Destroy {{ target_database }}"
community.mysql.mysql_db:
name: "{{ target_database }}"
state: absent
config_file: "/etc/mysql/mariadb.conf.d/50-client.cnf"
login_password: "{{ mysql_root_password }}"
- name: "Import database from {{ upload_directory }}/{{ uploaded_file }} to {{ target_database }}"
community.mysql.mysql_db:
name: "{{ target_database }}"
state: import
target: "/tmp/{{ uploaded_file }}"
config_file: "/etc/mysql/mariadb.conf.d/50-client.cnf"
login_password: "{{ mysql_root_password }}"
- name: "Send mattermost message"
uri:
url: "{{ mattermost_hook_smardigo }}"
method: POST
body: "{{ lookup('template','mattermost-deploy-end.json.j2') }}"
body_format: json
headers:
Content-Type: "application/json"
delegate_to: 127.0.0.1
become: false
when:
- send_status_messages # TODO: Message Refactor :')