From 0e9d830a64c58a96e13b2dcce376bac8648d6b2a Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 12 Sep 2018 10:17:59 -0700 Subject: [PATCH] Add job to run playbook on bridge.o.o This new job is a parent job allowing us to CD from Zuul via bridge.openstack.org. Using Zuul project ssh keys we add_host bridge.o.o to our running inventory on the executor then run ansible on bridge.o.o to run an ansible playbook in bridge.openstack.org:/opt/system-config/playbooks. Change-Id: I5cd2dcc53ac480459a22d9e19ef38af78a9e90f7 --- .zuul.yaml | 16 +++++++++++++++- playbooks/zuul/run-production-playbook.yaml | 12 ++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 playbooks/zuul/run-production-playbook.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 3b0cfb1a59..206b01dbc3 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -195,6 +195,20 @@ - playbooks/templates/clouds/ - testinfra/test_nodepool.py +- job: + name: system-config-run-production-playbook + description: | + Run specified playbook against productions hosts. + + This is a parent job designed to be inherited to enabled + CD deployment of our infrastructure. Set playbook_name to + specify the playbook relative to + bridge.openstack.org:/opt/system-config/playbooks + abstract: true + run: playbooks/zuul/run-production-playbook.yaml + vars: + ansible_forks: 5 + - project: templates: - system-config-zuul-role-integration @@ -222,4 +236,4 @@ - puppet-beaker-rspec-puppet-4-centos-7-infra-system-config - system-config-run-base - system-config-run-eavesdrop - - system-config-run-nodepool \ No newline at end of file + - system-config-run-nodepool diff --git a/playbooks/zuul/run-production-playbook.yaml b/playbooks/zuul/run-production-playbook.yaml new file mode 100644 index 0000000000..ac1004461d --- /dev/null +++ b/playbooks/zuul/run-production-playbook.yaml @@ -0,0 +1,12 @@ +- hosts: localhost + tasks: + - name: Add bridge.o.o to inventory + add_host: + name: bridge.openstack.org + ansible_user: root + +- hosts: bridge.openstack.org + tasks: + - name: Run specified playbook on bridge.o.o + command: ansible-playbook -f {{ ansible_forks }} /opt/system-config/playbooks/{{ playbook_name }} +