Created
November 13, 2018 16:19
-
-
Save hankpillow/1071114b2943a7665f40aab3fbf46b0f to your computer and use it in GitHub Desktop.
ansible playbook with mysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Create container | |
hosts: localhost | |
gather_facts: yes | |
tasks: | |
- name: Create Drupal container | |
register: new_container | |
docker_container: | |
privileged: yes | |
state: started | |
image: "ubuntu:trusty" | |
name: "ansible-container" | |
command: sleep infinity | |
recreate: yes | |
- name: Add host ansible-container | |
add_host: | |
hostname: ansible-container | |
ansible_connection: docker | |
- name: Install geerlingguy.mysql | |
command: ansible-galaxy install geerlingguy.mysql | |
- name: Install mysql | |
hosts: ansible-container | |
connection: docker | |
gather_facts: no | |
pre_tasks: | |
- name: Install python2 for Ansible | |
raw: bash -c "test -e /usr/bin/python || (apt -qqy update && apt install -qqy python-minimal)" | |
register: output | |
changed_when: output.stdout != "" | |
- name: Gathering Facts | |
setup: | |
roles: | |
- geerlingguy.mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment