From 3d432b4fe2b5b724b138c6ae6f7fc021ac45d818 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 12 Apr 2017 17:18:35 -0500 Subject: [PATCH] Update Apache, Git, and MySQL roles. --- provisioning/requirements.yml | 6 +- .../roles/geerlingguy.apache/meta/main.yml | 2 +- .../roles/geerlingguy.apache/tasks/main.yml | 2 +- provisioning/roles/geerlingguy.git/.gitignore | 3 +- .../roles/geerlingguy.git/.travis.yml | 54 ++++-------------- provisioning/roles/geerlingguy.git/LICENSE | 20 +++++++ provisioning/roles/geerlingguy.git/README.md | 2 +- .../roles/geerlingguy.git/meta/main.yml | 2 +- .../tasks/install-from-source.yml | 2 +- .../roles/geerlingguy.git/tests/README.md | 11 ++++ .../roles/geerlingguy.mysql/.gitignore | 2 + .../roles/geerlingguy.mysql/.travis.yml | 55 ++++++------------- provisioning/roles/geerlingguy.mysql/LICENSE | 20 +++++++ .../roles/geerlingguy.mysql/README.md | 25 ++++++++- .../roles/geerlingguy.mysql/defaults/main.yml | 1 + .../roles/geerlingguy.mysql/meta/main.yml | 2 +- .../tasks/secure-installation.yml | 4 +- .../geerlingguy.mysql/templates/my.cnf.j2 | 3 + .../roles/geerlingguy.mysql/tests/README.md | 11 ++++ 19 files changed, 133 insertions(+), 94 deletions(-) create mode 100644 provisioning/roles/geerlingguy.git/LICENSE create mode 100644 provisioning/roles/geerlingguy.git/tests/README.md create mode 100644 provisioning/roles/geerlingguy.mysql/.gitignore create mode 100644 provisioning/roles/geerlingguy.mysql/LICENSE create mode 100644 provisioning/roles/geerlingguy.mysql/tests/README.md diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index f3ba14b5e..702bf44aa 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -8,7 +8,7 @@ - src: geerlingguy.adminer version: 1.1.1 - src: geerlingguy.apache - version: 2.0.2 + version: 2.1.0 - src: geerlingguy.apache-php-fpm version: 1.0.2 - src: geerlingguy.blackfire @@ -28,7 +28,7 @@ - src: geerlingguy.firewall version: 2.2.0 - src: geerlingguy.git - version: 1.2.1 + version: 1.3.0 - src: geerlingguy.java version: 1.7.4 - src: geerlingguy.mailhog @@ -36,7 +36,7 @@ - src: geerlingguy.memcached version: 1.0.7 - src: geerlingguy.mysql - version: 2.5.0 + version: 2.6.0 - src: geerlingguy.nginx version: 2.0.0 - src: geerlingguy.nodejs diff --git a/provisioning/roles/geerlingguy.apache/meta/main.yml b/provisioning/roles/geerlingguy.apache/meta/main.yml index 5893a1737..2936b4bf1 100644 --- a/provisioning/roles/geerlingguy.apache/meta/main.yml +++ b/provisioning/roles/geerlingguy.apache/meta/main.yml @@ -6,7 +6,7 @@ galaxy_info: description: Apache 2.x for Linux. company: "Midwestern Mac, LLC" license: "license (BSD, MIT)" - min_ansible_version: 1.9 + min_ansible_version: 2.2 platforms: - name: EL versions: diff --git a/provisioning/roles/geerlingguy.apache/tasks/main.yml b/provisioning/roles/geerlingguy.apache/tasks/main.yml index fb47a38d1..0a6006408 100644 --- a/provisioning/roles/geerlingguy.apache/tasks/main.yml +++ b/provisioning/roles/geerlingguy.apache/tasks/main.yml @@ -20,7 +20,7 @@ - name: Get installed version of Apache. shell: "{{ apache_daemon_path }}{{ apache_daemon }} -v" changed_when: false - always_run: yes + check_mode: no register: _apache_version - name: Create apache_version variable. diff --git a/provisioning/roles/geerlingguy.git/.gitignore b/provisioning/roles/geerlingguy.git/.gitignore index b066709e0..c9b2377e3 100644 --- a/provisioning/roles/geerlingguy.git/.gitignore +++ b/provisioning/roles/geerlingguy.git/.gitignore @@ -1 +1,2 @@ -.LSOverride +*.retry +tests/test.sh diff --git a/provisioning/roles/geerlingguy.git/.travis.yml b/provisioning/roles/geerlingguy.git/.travis.yml index 68cc3cecd..bebd98101 100644 --- a/provisioning/roles/geerlingguy.git/.travis.yml +++ b/provisioning/roles/geerlingguy.git/.travis.yml @@ -4,83 +4,53 @@ services: docker env: # Test source install on latest supported OSes. - distro: centos7 - init: /usr/lib/systemd/systemd - run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" playbook: test-source.yml GIT_VERSION: 2.9.3 - distro: ubuntu1604 - init: /lib/systemd/systemd - run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" playbook: test-source.yml GIT_VERSION: 2.9.3 # Test package install on all supported OSes. - distro: centos7 - init: /usr/lib/systemd/systemd - run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" playbook: test.yml GIT_VERSION: 1.8.3.1 - distro: centos6 - init: /sbin/init - run_opts: "--privileged" playbook: test.yml GIT_VERSION: 1.7.1 - distro: fedora24 - init: /usr/lib/systemd/systemd - run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" playbook: test.yml GIT_VERSION: 2.7.4 - distro: ubuntu1604 - init: /lib/systemd/systemd - run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" playbook: test.yml GIT_VERSION: 2.7.4 - distro: ubuntu1404 - init: /sbin/init - run_opts: "--privileged" playbook: test.yml GIT_VERSION: 1.9.1 - distro: ubuntu1204 - init: /sbin/init - run_opts: "--privileged" playbook: test.yml GIT_VERSION: 1.7.9.5 - distro: debian8 - init: /lib/systemd/systemd - run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" playbook: test.yml GIT_VERSION: 2.1.4 -before_install: - # Pull container. - - 'docker pull geerlingguy/docker-${distro}-ansible:latest' - script: - - container_id=$(mktemp) - # Run container in detached state. - - 'docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"' - - # Ansible syntax check. - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} --syntax-check' + # Configure test script so we can run extra tests after playbook is run. + - export container_id=$(date +%s) + - export cleanup=false - # Test role. - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook}' + # Download test shim. + - wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/ + - chmod +x ${PWD}/tests/test.sh - # Test role idempotence. - - idempotence=$(mktemp) - - docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} | tee -a ${idempotence} - - > - tail ${idempotence} - | grep -q 'changed=0.*failed=0' - && (echo 'Idempotence test: pass' && exit 0) - || (echo 'Idempotence test: fail' && exit 1) + # Run tests. + - ${PWD}/tests/test.sh # Ensure Git is installed and at the right version. - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm which git' - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm test -x /usr/bin/git' + - 'docker exec --tty ${container_id} env TERM=xterm which git' + - 'docker exec --tty ${container_id} env TERM=xterm test -x /usr/bin/git' - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm git --version' - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm /usr/bin/git --version | grep -qF "$GIT_VERSION"' + - 'docker exec --tty ${container_id} env TERM=xterm git --version' + - 'docker exec --tty ${container_id} env TERM=xterm /usr/bin/git --version | grep -qF "$GIT_VERSION"' notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/provisioning/roles/geerlingguy.git/LICENSE b/provisioning/roles/geerlingguy.git/LICENSE new file mode 100644 index 000000000..4275cf3c1 --- /dev/null +++ b/provisioning/roles/geerlingguy.git/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2017 Jeff Geerling + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/provisioning/roles/geerlingguy.git/README.md b/provisioning/roles/geerlingguy.git/README.md index 0e7174610..02733dd32 100644 --- a/provisioning/roles/geerlingguy.git/README.md +++ b/provisioning/roles/geerlingguy.git/README.md @@ -52,4 +52,4 @@ MIT / BSD ## Author Information -This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). +This role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). diff --git a/provisioning/roles/geerlingguy.git/meta/main.yml b/provisioning/roles/geerlingguy.git/meta/main.yml index fcfd140fa..0c0174032 100644 --- a/provisioning/roles/geerlingguy.git/meta/main.yml +++ b/provisioning/roles/geerlingguy.git/meta/main.yml @@ -6,7 +6,7 @@ galaxy_info: description: Git version control software company: "Midwestern Mac, LLC" license: "license (BSD, MIT)" - min_ansible_version: 2.0 + min_ansible_version: 2.2 platforms: - name: EL versions: diff --git a/provisioning/roles/geerlingguy.git/tasks/install-from-source.yml b/provisioning/roles/geerlingguy.git/tasks/install-from-source.yml index d634652e6..829e70c25 100644 --- a/provisioning/roles/geerlingguy.git/tasks/install-from-source.yml +++ b/provisioning/roles/geerlingguy.git/tasks/install-from-source.yml @@ -30,7 +30,7 @@ warn=no changed_when: false failed_when: false - always_run: yes + check_mode: no register: git_installed_version - name: Force git install if the version numbers do not match diff --git a/provisioning/roles/geerlingguy.git/tests/README.md b/provisioning/roles/geerlingguy.git/tests/README.md new file mode 100644 index 000000000..6fb211721 --- /dev/null +++ b/provisioning/roles/geerlingguy.git/tests/README.md @@ -0,0 +1,11 @@ +# Ansible Role tests + +To run the test playbook(s) in this directory: + + 1. Install and start Docker. + 1. Download the test shim (see .travis.yml file for the URL) into `tests/test.sh`: + - `wget -O tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/` + 1. Make the test shim executable: `chmod +x tests/test.sh`. + 1. Run (from the role root directory) `distro=[distro] playbook=[playbook] ./tests/test.sh` + +If you don't want the container to be automatically deleted after the test playbook is run, add the following environment variables: `cleanup=false container_id=$(date +%s)` diff --git a/provisioning/roles/geerlingguy.mysql/.gitignore b/provisioning/roles/geerlingguy.mysql/.gitignore new file mode 100644 index 000000000..c9b2377e3 --- /dev/null +++ b/provisioning/roles/geerlingguy.mysql/.gitignore @@ -0,0 +1,2 @@ +*.retry +tests/test.sh diff --git a/provisioning/roles/geerlingguy.mysql/.travis.yml b/provisioning/roles/geerlingguy.mysql/.travis.yml index b8b941645..6e3528df3 100644 --- a/provisioning/roles/geerlingguy.mysql/.travis.yml +++ b/provisioning/roles/geerlingguy.mysql/.travis.yml @@ -3,73 +3,50 @@ services: docker env: - distro: centos7 - init: /usr/lib/systemd/systemd - run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" playbook: centos-7-test.yml - distro: centos6 - init: /sbin/init - run_opts: "" playbook: test.yml - distro: ubuntu1604 - init: /lib/systemd/systemd - run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" playbook: test.yml - distro: ubuntu1404 - init: /sbin/init - run_opts: "" playbook: test.yml -services: - - docker - -before_install: - # Pull container - - 'docker pull geerlingguy/docker-${distro}-ansible:latest' - script: - - container_id=$(mktemp) - # Run container in detached state. - - 'docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"' + # Configure test script so we can run extra tests after playbook is run. + - export container_id=$(date +%s) + - export cleanup=false - # Ansible syntax check. - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} --syntax-check' + # Download test shim. + - wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/ + - chmod +x ${PWD}/tests/test.sh - # Test role. - - 'docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook}' - - # Test role idempotence. - - idempotence=$(mktemp) - - docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} | tee -a ${idempotence} - - > - tail ${idempotence} - | grep -q 'changed=0.*failed=0' - && (echo 'Idempotence test: pass' && exit 0) - || (echo 'Idempotence test: fail' && exit 1) + # Run tests. + - ${PWD}/tests/test.sh # Some MySQL debugging (show all the logs). - - docker exec --tty "$(cat ${container_id})" env TERM=xterm ls -lah /var/log - - docker exec --tty "$(cat ${container_id})" env TERM=xterm cat /var/log/mysql/error.log || true - - docker exec --tty "$(cat ${container_id})" env TERM=xterm cat /var/log/mysql.err || true + - docker exec --tty ${container_id} env TERM=xterm ls -lah /var/log + - docker exec --tty ${container_id} env TERM=xterm cat /var/log/mysql/error.log || true + - docker exec --tty ${container_id} env TERM=xterm cat /var/log/mysql.err || true # Check to make sure we can connect to MySQL via Unix socket. - > - sudo docker exec "$(cat ${container_id})" mysql -u root -proot -e 'show databases;' + sudo docker exec ${container_id} mysql -u root -proot -e 'show databases;' | grep -q 'information_schema' && (echo 'MySQL running normally' && exit 0) || (echo 'MySQL not running' && exit 1) # Check to make sure we can connect to MySQL via TCP. - > - sudo docker exec "$(cat ${container_id})" mysql -u root -proot -h 127.0.0.1 -e 'show databases;' + sudo docker exec ${container_id} mysql -u root -proot -h 127.0.0.1 -e 'show databases;' | grep -q 'information_schema' && (echo 'MySQL running normally' && exit 0) || (echo 'MySQL not running' && exit 1) after_failure: # Check MySQL settings. - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm cat /var/log/mysql/error.log' - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm cat /var/log/mysql.err' - - 'docker exec --tty "$(cat ${container_id})" env TERM=xterm cat /var/log/mysql.log' + - 'docker exec --tty ${container_id} env TERM=xterm cat /var/log/mysql/error.log' + - 'docker exec --tty ${container_id} env TERM=xterm cat /var/log/mysql.err' + - 'docker exec --tty ${container_id} env TERM=xterm cat /var/log/mysql.log' notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/provisioning/roles/geerlingguy.mysql/LICENSE b/provisioning/roles/geerlingguy.mysql/LICENSE new file mode 100644 index 000000000..4275cf3c1 --- /dev/null +++ b/provisioning/roles/geerlingguy.mysql/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2017 Jeff Geerling + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/provisioning/roles/geerlingguy.mysql/README.md b/provisioning/roles/geerlingguy.mysql/README.md index 975f0d730..9dcef82eb 100644 --- a/provisioning/roles/geerlingguy.mysql/README.md +++ b/provisioning/roles/geerlingguy.mysql/README.md @@ -107,6 +107,29 @@ The rest of the settings in `defaults/main.yml` control MySQL's memory usage and Replication settings. Set `mysql_server_id` and `mysql_replication_role` by server (e.g. the master would be ID `1`, with the `mysql_replication_role` of `master`, and the slave would be ID `2`, with the `mysql_replication_role` of `slave`). The `mysql_replication_user` uses the same keys as `mysql_users`, and is created on master servers, and used to replicate on all the slaves. +### Later versions of MySQL on CentOS 7 + +If you want to install MySQL from the official repository instead of installing the system default MariaDB equivalents, you can add the following `pre_tasks` task in your playbook: + +```yaml + pre_tasks: + - name: Install the MySQL repo. + yum: + name: http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm + state: present + when: ansible_os_family == "RedHat" + + - name: Override variables for MySQL (RedHat). + set_fact: + mysql_daemon: mysqld + mysql_packages: ['mysql-server'] + mysql_log_error: /var/log/mysqld.err + mysql_syslog_tag: mysqld + mysql_pid_file: /var/run/mysqld/mysqld.pid + mysql_socket: /var/lib/mysql/mysql.sock + when: ansible_os_family == "RedHat" +``` + ### MariaDB usage This role works with either MySQL or a compatible version of MariaDB. On RHEL/CentOS 7+, the mariadb database engine was substituted as the default MySQL replacement package. No modifications are necessary though all of the variables still reference 'mysql' instead of mariadb. @@ -152,4 +175,4 @@ MIT / BSD ## Author Information -This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). +This role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). diff --git a/provisioning/roles/geerlingguy.mysql/defaults/main.yml b/provisioning/roles/geerlingguy.mysql/defaults/main.yml index 33c5405a6..ac7dc9838 100644 --- a/provisioning/roles/geerlingguy.mysql/defaults/main.yml +++ b/provisioning/roles/geerlingguy.mysql/defaults/main.yml @@ -39,6 +39,7 @@ mysql_port: "3306" mysql_bind_address: '0.0.0.0' mysql_skip_name_resolve: no mysql_datadir: /var/lib/mysql +mysql_sql_mode: '' # The following variables have a default value depending on operating system. # mysql_pid_file: /var/run/mysqld/mysqld.pid # mysql_socket: /var/lib/mysql/mysql.sock diff --git a/provisioning/roles/geerlingguy.mysql/meta/main.yml b/provisioning/roles/geerlingguy.mysql/meta/main.yml index 0432274a6..bc2d46b29 100644 --- a/provisioning/roles/geerlingguy.mysql/meta/main.yml +++ b/provisioning/roles/geerlingguy.mysql/meta/main.yml @@ -6,7 +6,7 @@ galaxy_info: description: MySQL server for RHEL/CentOS and Debian/Ubuntu. company: "Midwestern Mac, LLC" license: "license (BSD, MIT)" - min_ansible_version: 1.9 + min_ansible_version: 2.2 platforms: - name: EL versions: diff --git a/provisioning/roles/geerlingguy.mysql/tasks/secure-installation.yml b/provisioning/roles/geerlingguy.mysql/tasks/secure-installation.yml index 3e386c5e0..fc1e4eecf 100644 --- a/provisioning/roles/geerlingguy.mysql/tasks/secure-installation.yml +++ b/provisioning/roles/geerlingguy.mysql/tasks/secure-installation.yml @@ -32,7 +32,7 @@ command: mysql -NBe "SELECT Host FROM mysql.user WHERE User = '{{ mysql_root_username }}' ORDER BY (Host='localhost') ASC" register: mysql_root_hosts changed_when: false - always_run: true + check_mode: no when: mysql_install_packages | bool or mysql_root_password_update # Note: We do not use mysql_user for this operation, as it doesn't always update @@ -67,7 +67,7 @@ command: mysql -NBe 'SELECT Host FROM mysql.user WHERE User = ""' register: mysql_anonymous_hosts changed_when: false - always_run: true + check_mode: no - name: Remove anonymous MySQL users. mysql_user: diff --git a/provisioning/roles/geerlingguy.mysql/templates/my.cnf.j2 b/provisioning/roles/geerlingguy.mysql/templates/my.cnf.j2 index e3a3c0ca9..eb5381e3b 100644 --- a/provisioning/roles/geerlingguy.mysql/templates/my.cnf.j2 +++ b/provisioning/roles/geerlingguy.mysql/templates/my.cnf.j2 @@ -12,6 +12,9 @@ pid-file = {{ mysql_pid_file }} {% if mysql_skip_name_resolve %} skip-name-resolve {% endif %} +{% if mysql_sql_mode %} +sql_mode = {{ mysql_sql_mode }} +{% endif %} # Logging configuration. {% if mysql_log_error == 'syslog' or mysql_log == 'syslog' %} diff --git a/provisioning/roles/geerlingguy.mysql/tests/README.md b/provisioning/roles/geerlingguy.mysql/tests/README.md new file mode 100644 index 000000000..6fb211721 --- /dev/null +++ b/provisioning/roles/geerlingguy.mysql/tests/README.md @@ -0,0 +1,11 @@ +# Ansible Role tests + +To run the test playbook(s) in this directory: + + 1. Install and start Docker. + 1. Download the test shim (see .travis.yml file for the URL) into `tests/test.sh`: + - `wget -O tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/` + 1. Make the test shim executable: `chmod +x tests/test.sh`. + 1. Run (from the role root directory) `distro=[distro] playbook=[playbook] ./tests/test.sh` + +If you don't want the container to be automatically deleted after the test playbook is run, add the following environment variables: `cleanup=false container_id=$(date +%s)`