From 7c173d9ea5788e7bdf236da78b057f897533d177 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Wed, 27 Feb 2019 08:39:32 -0500 Subject: [PATCH] Move playbooks/bastion.yaml into tests folder This really isn't needed for production deployments, it is more to make sure our testing in the gate is happy. Change-Id: Ic8e367892fbb54a57d9864e9cdb8579783a5d83f Signed-off-by: Paul Belanger --- .../bastion.yaml => tests/playbooks/bastion/site.yaml | 8 ++++---- tests/playbooks/run.yaml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) rename playbooks/bastion.yaml => tests/playbooks/bastion/site.yaml (85%) diff --git a/playbooks/bastion.yaml b/tests/playbooks/bastion/site.yaml similarity index 85% rename from playbooks/bastion.yaml rename to tests/playbooks/bastion/site.yaml index f7600ab..6c8a516 100644 --- a/playbooks/bastion.yaml +++ b/tests/playbooks/bastion/site.yaml @@ -12,21 +12,21 @@ # License for the specific language governing permissions and limitations # under the License. --- -- name: Bootstrap bastion node. +- name: Bootstrap bastion node hosts: bastion pre_tasks: - - name: Create SSH keys (if missing). + - name: Create SSH keys (if missing) command: ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" args: creates: ~/.ssh/id_rsa - - name: Ensure SSH public key is authorized. + - name: Ensure SSH public key is authorized authorized_key: user: "{{ lookup('env', 'USER') }}" key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}" - - name: Ensure remote SSH host keys are known. + - name: Ensure remote SSH host keys are known known_hosts: name: "{{ hostvars[item].ansible_host }}" key: "{{ lookup('pipe', 'ssh-keyscan -t rsa {{ hostvars[item].ansible_host }}') }}" diff --git a/tests/playbooks/run.yaml b/tests/playbooks/run.yaml index 8504b4d..10c14ff 100644 --- a/tests/playbooks/run.yaml +++ b/tests/playbooks/run.yaml @@ -1,10 +1,10 @@ --- - hosts: all tasks: - - name: Bootstrap bastion node using ansible + - name: Setup SSH host keys for ansible args: chdir: "{{ windmill_src_dir }}" - shell: tox -evenv -- ansible-playbook -i inventory/testing/hosts playbooks/bastion.yaml + shell: tox -evenv -- ansible-playbook -i inventory/testing/hosts tests/playbooks/bastion/site.yaml - name: Run ansible-playbook for site.yaml args: