Modern Ansible

pull/35/head
Emilien Mantel 2019-04-12 09:38:42 +02:00
parent fb4c70827c
commit 1ec3b388a0
7 changed files with 20 additions and 19 deletions

View File

@ -1,12 +1,13 @@
env: env:
- PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.5,<2.6'
- PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.5,<2.6'
- PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.5,<2.6'
- PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.6,<2.7'
matrix: - PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.6,<2.7'
allow_failures: - PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- env: PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.3,<2.4' - PLATFORM='docker-stretch-default-mariadb-master' ANSIBLE_VERSION='ansible>=2.7,<2.7'
fast_finish: true - PLATFORM='docker-stretch-upstream-mariadb-master' ANSIBLE_VERSION='ansible>=2.7,<2.7'
- PLATFORM='docker-stretch-upstream-mariadbgalera-1' ANSIBLE_VERSION='ansible>=2.7,<2.7'
sudo: required sudo: required

View File

@ -21,7 +21,7 @@ Notes
Requirements Requirements
------------ ------------
None. Ansible 2.5+
Role Variables Role Variables
-------------- --------------
@ -61,7 +61,7 @@ Check "priv" syntax in [mysql\_user module documentation](http://docs.ansible.co
### Packaging ### Packaging
- `mariadb_version`: 10.0 / 10.1 / 10.2 - `mariadb_version`: 10.0 / 10.1 / 10.2 / 10.3
- `mariadb_repository`: MariaDB upstream APT repository (see: [MariaDB repositories tool](https://downloads.mariadb.org/mariadb/repositories)) - `mariadb_repository`: MariaDB upstream APT repository (see: [MariaDB repositories tool](https://downloads.mariadb.org/mariadb/repositories))
- `mariadb_percona_repository`: Percona upstream APT repository (see: [Percona APT doc](http://www.percona.com/doc/percona-server/5.5/installation/apt_repo.html)) - `mariadb_percona_repository`: Percona upstream APT repository (see: [Percona APT doc](http://www.percona.com/doc/percona-server/5.5/installation/apt_repo.html))
- `mariadb_use_percona_apt`: Force using Percona APT repository (useful when you want to use latest version of percona toolkits, xtrabackup... etc) - `mariadb_use_percona_apt`: Force using Percona APT repository (useful when you want to use latest version of percona toolkits, xtrabackup... etc)

View File

@ -4,7 +4,7 @@ galaxy_info:
description: Install and configure MariaDB (and Galera Cluster) on Debian description: Install and configure MariaDB (and Galera Cluster) on Debian
company: company:
license: GPLv2 license: GPLv2
min_ansible_version: 2.3 min_ansible_version: 2.5
platforms: platforms:
- name: Debian - name: Debian
versions: versions:

View File

@ -4,7 +4,7 @@
apt_key: apt_key:
keyserver: "{{ mariadb_key_server }}" keyserver: "{{ mariadb_key_server }}"
id: "{{ item }}" id: "{{ item }}"
with_items: "{{ mariadb_key_ids }}" loop: "{{ mariadb_key_ids }}"
- name: TEMPLATE | Deploy APT pinning (prevent upgrades from Debian) - name: TEMPLATE | Deploy APT pinning (prevent upgrades from Debian)
template: template:

View File

@ -61,7 +61,7 @@
mysql_db: mysql_db:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: "{{ mariadb_databases }}" loop: "{{ mariadb_databases }}"
- name: MYSQL_USER | Manages users... - name: MYSQL_USER | Manages users...
mysql_user: mysql_user:
@ -71,7 +71,7 @@
host: "{{ item.host | default(omit) }}" host: "{{ item.host | default(omit) }}"
host_all: "{{ item.host_all | default(omit) }}" host_all: "{{ item.host_all | default(omit) }}"
state: present state: present
with_items: "{{ mariadb_users }}" loop: "{{ mariadb_users }}"
- name: TEMPLATE | Deploy logrotate configuration - name: TEMPLATE | Deploy logrotate configuration
template: template:

View File

@ -5,7 +5,7 @@
name: root name: root
host: "{{ item }}" host: "{{ item }}"
password: "{{ mariadb_root_password }}" password: "{{ mariadb_root_password }}"
with_items: loop:
- "{{ ansible_hostname }}" - "{{ ansible_hostname }}"
- 127.0.0.1 - 127.0.0.1
- ::1 - ::1
@ -16,7 +16,7 @@
name: '' name: ''
host: "{{ item }}" host: "{{ item }}"
state: absent state: absent
with_items: loop:
- "{{ ansible_hostname }}" - "{{ ansible_hostname }}"
- 127.0.0.1 - 127.0.0.1
- ::1 - ::1

View File

@ -3,7 +3,7 @@
- hosts: all - hosts: all
tasks: tasks:
- apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600 - apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600
with_items: loop:
- ca-certificates - ca-certificates
- curl - curl
- strace - strace
@ -16,7 +16,7 @@
- copy: src=import1.sql dest=/tmp/import1.sql - copy: src=import1.sql dest=/tmp/import1.sql
register: c register: c
- mysql_db: name={{ item }} state=import target=/tmp/import1.sql - mysql_db: name={{ item }} state=import target=/tmp/import1.sql
with_items: ['testrepl', 'norepl'] loop: ['testrepl', 'norepl']
when: c.changed when: c.changed
- hosts: slave - hosts: slave
@ -37,7 +37,7 @@
delegate_to: "{{ mariadb_slave_import_from }}" delegate_to: "{{ mariadb_slave_import_from }}"
register: c register: c
- mysql_db: name={{ item }} state=import target=/tmp/import2.sql - mysql_db: name={{ item }} state=import target=/tmp/import2.sql
with_items: ['testrepl', 'norepl'] loop: ['testrepl', 'norepl']
delegate_to: "{{ mariadb_slave_import_from }}" delegate_to: "{{ mariadb_slave_import_from }}"
when: c.changed when: c.changed
- mysql_replication: mode=getslave - mysql_replication: mode=getslave