From b55f100d764134ebbf8baa48548514df2ea491fa Mon Sep 17 00:00:00 2001 From: David Moreau-Simard Date: Sat, 30 Sep 2017 21:03:13 -0400 Subject: [PATCH] Add backwards-compat playbook for /etc/nodepool/provider The TripleO CI legacy jobs rely on the /etc/nodepool/provider file which is no longer provided in Zuul v3. These variables are now available directly through Ansible but we're mostly interested in getting the existing legacy jobs working for the time being. Change-Id: I9e15d8c292823b3709f7ceef876c7c5bf8b6b8f5 --- playbooks/legacy/nodepool-provider/README.rst | 2 ++ playbooks/legacy/nodepool-provider/pre.yaml | 19 +++++++++++++++++++ zuul.d/zuul-legacy-jobs.yaml | 1 + 3 files changed, 22 insertions(+) create mode 100644 playbooks/legacy/nodepool-provider/README.rst create mode 100644 playbooks/legacy/nodepool-provider/pre.yaml diff --git a/playbooks/legacy/nodepool-provider/README.rst b/playbooks/legacy/nodepool-provider/README.rst new file mode 100644 index 00000000..144f16af --- /dev/null +++ b/playbooks/legacy/nodepool-provider/README.rst @@ -0,0 +1,2 @@ +This playbook writes a backwards compatible /etc/nodepool/provider file for +legacy jobs running on Zuul v3 which no longer provides that file. diff --git a/playbooks/legacy/nodepool-provider/pre.yaml b/playbooks/legacy/nodepool-provider/pre.yaml new file mode 100644 index 00000000..2c1eda4c --- /dev/null +++ b/playbooks/legacy/nodepool-provider/pre.yaml @@ -0,0 +1,19 @@ +- name: Configure /etc/nodepool/provider for backwards compatibility + hosts: all + gather_facts: no + tasks: + - name: Warn that /etc/nodepool/provider is deprecated + debug: + msg: | + The /etc/nodepool/provider file no longer exists and is being created + for backwards compatibility purposes. The variables provided by this + file are now available through Ansible under hostvars['nodepool']. + + - name: Create /etc/nodepool/provider file + copy: + content: | + NODEPOOL_PROVIDER={{ hostvars['nodepool']['provider'] }} + NODEPOOL_CLOUD={{ hostvars['nodepool']['cloud'] }} + NODEPOOL_REGION={{ hostvars['nodepool']['region'] }} + NODEPOOL_AZ={{ hostvars['nodepool']['az'] }} + dest: /etc/nodepool/provider diff --git a/zuul.d/zuul-legacy-jobs.yaml b/zuul.d/zuul-legacy-jobs.yaml index eec5a848..2f162f30 100644 --- a/zuul.d/zuul-legacy-jobs.yaml +++ b/zuul.d/zuul-legacy-jobs.yaml @@ -8656,6 +8656,7 @@ description: | Base job template for TripleO jobs that leverage devstack-gate/dsvm parent: legacy-publish-openstack-artifacts + pre-run: playbooks/legacy/nodepool-provider/pre required-projects: - openstack/aodh - openstack/barbican