ara-collection/tests/zuul_post_with_mysql.yaml
David Moreau Simard ec0f681252
CI: Import role integration jobs from ara repository
This imports the role integration test playbooks and Zuul CI jobs from
the main ara repository.

The distributed-sqlite job is meant to be voting but there is a
regression that needs to be addressed first [1].

[1]: https://github.com/ansible-community/ara/issues/149

Change-Id: I19af271b6740c953cb29872e2474fb6d5a7a03d2
2020-07-23 22:09:36 -04:00

35 lines
1.1 KiB
YAML

---
# Copyright (c) 2020 The ARA Records Ansible authors
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- name: Recover mysql server data
hosts: ara-database-server
gather_facts: yes
vars_files:
- vars/mysql_tests.yaml
tasks:
- name: Ensure mysqldump is installed
become: yes
package:
name: mariadb
state: present
# The zuul-output directory is retrieved by the fetch-output role
# https://opendev.org/zuul/zuul-jobs/src/branch/master/roles/fetch-output
- name: Create log directory
file:
path: "{{ ansible_user_dir }}/zuul-output/logs"
state: directory
recurse: yes
# Dump is suffixed by .txt so we don't need magic mimetypes when
# viewing on the web.
- name: Dump database file
shell: |
mysqldump \
--host=127.0.0.1 \
--port={{ ara_api_database_port }} \
--user={{ ara_api_database_user }} \
--password={{ ara_api_database_password }} \
{{ ara_api_database_name }} > {{ ansible_user_dir }}/zuul-output/logs/mysqldump.sql.txt