root 5 years ago
parent
commit
91a441e5b2
  1. 13
      roles/lxc_swarm/tasks/lxc_nodes.yml
  2. 8
      roles/lxc_swarm/tasks/main.yml

13
roles/lxc_swarm/tasks/lxc_nodes.yml

@ -16,7 +16,6 @@
with_items:
- "worker1"
- "worker2"
# - "worker3"
tags: lxc
- name: Start lxc containers
@ -24,5 +23,15 @@
with_items:
- "worker1"
- "worker2"
# - "worker3"
tags: lxc
- name: Ensure container key is up-to-date locally
shell: ssh-keyscan {{ item }} >> ~/.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']

8
roles/lxc_swarm/tasks/main.yml

@ -21,14 +21,6 @@
- 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
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']

Loading…
Cancel
Save