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.
 
 
 

46 lines
1.2 KiB

---
# tasks file for roles/galera_swarm
- name: Load in local SSH key path
set_fact:
my_ssh_key: "{{ lookup('env','HOME') }}/.ssh/id_rsa.pub"
when: inventory_hostname in groups['manager']
tags: lxc
- name: Local user has an SSH key
command: stat {{ my_ssh_key }}
changed_when: false
run_once: true
when: inventory_hostname in groups['manager']
- include: prepare_host.yml
when: inventory_hostname in groups['manager']
- include: lxc_prepare.yml
when: inventory_hostname in groups['manager']
- include: lxc_nodes.yml
when: inventory_hostname in groups['manager']
- name: container key is up-to-date locally
shell: ssh-keyscan {{ workers }} >> ~/.ssh/known_hosts
# with_items:
# - "10.0.3.100"
# - "10.0.3.101"
when: inventory_hostname in groups['manager']
- name: Install python on LXC container
raw: which python || (apt-get -y update && apt-get install -y python)
when: inventory_hostname in groups['workers']
- include: prepare_host.yml
when: inventory_hostname in groups['workers']
- include: swarm.yml
tags: swarm
- setup:
tags: swarm, Dockerfile
- include: Dockerfile.yml
when: inventory_hostname in groups['workers']
tags: Dockerfile,swarm