From 91a441e5b2ad377e19fae98d526034096097ce0f Mon Sep 17 00:00:00 2001 From: root Date: Mon, 8 Jun 2020 15:45:22 +0000 Subject: [PATCH] Update --- roles/lxc_swarm/tasks/lxc_nodes.yml | 13 +++++++++++-- roles/lxc_swarm/tasks/main.yml | 8 -------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/roles/lxc_swarm/tasks/lxc_nodes.yml b/roles/lxc_swarm/tasks/lxc_nodes.yml index c730d0b..2c12c65 100644 --- a/roles/lxc_swarm/tasks/lxc_nodes.yml +++ b/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'] diff --git a/roles/lxc_swarm/tasks/main.yml b/roles/lxc_swarm/tasks/main.yml index 76bf018..cc85ad5 100644 --- a/roles/lxc_swarm/tasks/main.yml +++ b/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']