Browse Source

Pass in a ref for the project_config repo

When running ansible we need to pass a specific version of
project-config through to puppet from ansible. Do this via the
project_config_ref fact that the puppet role in ansible understands.

Depends-On: Id99c3c2c20764ed4ba4259bd53f8067289374403
Change-Id: I88995c81c13080d913bac239a7635619cdc34441
Clark Boylan 4 years ago
parent
commit
0441e7c7f0

+ 16
- 2
modules/openstack_project/files/ansible/playbooks/remote_puppet_git.yaml View File

@@ -1,10 +1,24 @@
1 1
 ---
2
+- hosts: localhost
3
+  gather_facts: false
4
+  connection: local
5
+  tasks:
6
+    # Note that git module does ls-remote if clone is set to no and places
7
+    # the remote_head value in returndict.after
8
+    - git: repo=https://git.openstack.org/openstack-infra/project-config clone=no
9
+      register: gitinfo
2 10
 - hosts: git0*
3 11
   gather_facts: false
4 12
   max_fail_percentage: 1
5 13
   roles:
6
-    - { role: puppet, puppetmaster: puppetmaster.openstack.org }
14
+    - role: puppet
15
+      puppetmaster: puppetmaster.openstack.org
16
+      facts:
17
+        project_config_ref: "{{ hostvars.localhost.gitinfo.after }}"
7 18
 - hosts: review.openstack.org
8 19
   gather_facts: false
9 20
   roles:
10
-    - { role: puppet, puppetmaster: puppetmaster.openstack.org }
21
+    - role: puppet
22
+      puppetmaster: puppetmaster.openstack.org
23
+      facts:
24
+        project_config_ref: "{{ hostvars.localhost.gitinfo.after }}"

Loading…
Cancel
Save