Galera cluster deployment based on docker swarm using Linux Containers (LXC) with automatic deployment via Ansible.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 lines
809 B

---
- setup:
tags: galera
- name: Copy galera template
template:
src: galera.cnf.j2
dest: /opt/galera.cnf
owner: root
group: root
mode: '0644'
remote_src: no
tags: galera
- name: Galera template fix
shell: sed -i "s/ /,/g;s/ 1/1/g;s/ "/"/g" /opt/galera.cnf
#- name: set mysql options fact
# set_fact:
# extra_docker_options: "--wsrep-new-cluster"
# when: ansible_hostname == 'worker1'
- name: Copy Dockerfile template
template:
src: Dockerfile.j2
dest: /opt/Dockerfile
remote_src: no
#- name: Build 'swarm-galera' image
# docker_image:
# name: 'swarm-galera'
# build:
# path: /
# tag: v1
# source: build
- name: Build image from Dockerfile
shell: docker build -t ubuntu:galera-node-{{ ansible_hostname }} .
args:
chdir: /opt