Skip to content

fourforbusiness/ansible-role-mysql-prepare-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Role: SQL Prepare DB

Build Status Ansible-Galaxy License: MIT

A collection of tasks that can be used as a toolset to prepare the target machines MySQL-Database.

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

  • remote_tmp_folder
    The folder on the remote system where to copy the dumps local_dump_folder
    The folder in the hosts file system with the dumps

  • mysql_import_dumps
    The config variables for each dump.

    • Mandatory sub-key/values are:

      • filename (string)
      • database (string) (database must exist on the given mysql-server)
    • Optional sub-key/values are:

      • replacements (List)
        • pattern (string) + replacement (string)
          The inclusion of replacements cause the role to replace all listed pattern found in the sql-file with replacement.
  • mysql_additional_scripts
    The additional mysql-scripts to execute (this is only executed if at least 1 dump was given for import and if it failes, it will not stop the playbook from provisioning)

Dependencies

Example Playbook

- hosts: db-servers
  become: yes
  vars_files:
    - vars/main.yml
  roles:
    - geerlingguy.mysql
    - fourforbusiness.mysql-prepare-db

Inside vars/main.yml:

    mysql_import_dumps:
      - filename: test_dump.sql
        database: test_database
        replacements:
          - pattern: xyz.de
            replacement: xyz.local
          - pattern: https
            replacement: http

License

MIT / BSD

Author Information

This role was created in 2018 by four for business AG.

About

Simple role to import dumps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published