From b3c01b30b3cd9aaae72c557a86cdfe648bfe9e9c Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 3 Sep 2020 09:28:16 +1000 Subject: [PATCH] install-ansible: move install_modules.sh to puppet-setup-ansible Modules are collected on bridge and then synchronized to remote hosts where puppet is run. This is done to ensure an atomic run of puppet across affected hosts. These modules are described in modules.env and cloned by install_modules.sh. Currently this is done in install-ansible, but after some recent refactoring (I3b1cea5a25974f56ea9202e252af7b8420f4adc9) the best home for it appears to now be in puppet-setup-ansible; just before the script is run. Change-Id: I4b1d709d7037e2851d73be4bc7a202f52858ad4f --- playbooks/roles/install-ansible/tasks/main.yaml | 15 --------------- .../files/install_modules.sh | 0 .../files/modules.env | 0 .../roles/puppet-setup-ansible/tasks/main.yaml | 13 +++++++++++++ 4 files changed, 13 insertions(+), 15 deletions(-) rename playbooks/roles/{install-ansible => puppet-setup-ansible}/files/install_modules.sh (100%) rename playbooks/roles/{install-ansible => puppet-setup-ansible}/files/modules.env (100%) diff --git a/playbooks/roles/install-ansible/tasks/main.yaml b/playbooks/roles/install-ansible/tasks/main.yaml index f2744200b2..19cc226442 100644 --- a/playbooks/roles/install-ansible/tasks/main.yaml +++ b/playbooks/roles/install-ansible/tasks/main.yaml @@ -119,21 +119,6 @@ owner: root group: root -# Yeah. This is install-ansible. But we need to do this and doing it when -# we install the ansible stuff seems like the right time workflow-wise. -- name: Ensure puppet directory - file: - state: directory - path: /etc/puppet - -- name: Install puppet module management scripts - copy: - src: '{{ item }}' - dest: '/etc/puppet/{{ item }}' - loop: - - install_modules.sh - - modules.env - - name: Copy yamlgroup inventory in place copy: src: inventory_plugins/yamlgroup.py diff --git a/playbooks/roles/install-ansible/files/install_modules.sh b/playbooks/roles/puppet-setup-ansible/files/install_modules.sh similarity index 100% rename from playbooks/roles/install-ansible/files/install_modules.sh rename to playbooks/roles/puppet-setup-ansible/files/install_modules.sh diff --git a/playbooks/roles/install-ansible/files/modules.env b/playbooks/roles/puppet-setup-ansible/files/modules.env similarity index 100% rename from playbooks/roles/install-ansible/files/modules.env rename to playbooks/roles/puppet-setup-ansible/files/modules.env diff --git a/playbooks/roles/puppet-setup-ansible/tasks/main.yaml b/playbooks/roles/puppet-setup-ansible/tasks/main.yaml index dea701c0cb..bb2bf70bd3 100644 --- a/playbooks/roles/puppet-setup-ansible/tasks/main.yaml +++ b/playbooks/roles/puppet-setup-ansible/tasks/main.yaml @@ -4,6 +4,19 @@ ansible_roles: - puppet +- name: Ensure puppet directory + file: + state: directory + path: /etc/puppet + +- name: Install puppet module management scripts + copy: + src: '{{ item }}' + dest: '/etc/puppet/{{ item }}' + loop: + - install_modules.sh + - modules.env + - name: Run puppet module install on bridge command: cmd: bash install_modules.sh