-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmysql.yml
39 lines (39 loc) · 940 Bytes
/
mysql.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
- hosts: webserver
become: true
gather_facts: no
ignore_errors: yes
tasks:
- name: create build directory
file:
path: /root/mysql
state: directory
owner: root
group: root
mode: '0755'
- name: copy Dockerfile
copy:
src: /root/Dockerfile
dest: /root/mysql/
owner: root
group: root
mode: '0777'
- name: copy sql scripts
copy:
src: /root/sql-scripts
dest: /root/mysql/
owner: root
group: root
mode: '0777'
- name: build container image
shell: docker build -t mysql /root/mysql/
- name: create docker container
docker_container:
name: mysql-container
image: mysql
- name: Check if container is running
shell: docker ps
register: container_info
- name: List Container info
debug:
msg: "{{container_info.stdout}}"