From 9ce4a353e66880ead470fe7ecd0f49d77cbc6cba Mon Sep 17 00:00:00 2001
From: Colleen Murphy <colleen@gazlene.net>
Date: Wed, 6 Jun 2018 20:04:24 +0200
Subject: [PATCH] Add support for turning on the future parser

If a host is a member of the 'futureparser' group, pass the
'futureparser' option to the puppet role, which will turn on parser =
future in puppet.conf when manage_config is true and when the node isn't
already using puppet 4. Nodes can be added one at a time by adding them
to modules/openstack_project/files/puppetmaster/groups.txt.

Depends-On: https://review.openstack.org/572856
Change-Id: I54e19ef6164658da8e0e5bff72a1964b88b81242
---
 playbooks/remote_puppet_adhoc.yaml | 1 +
 playbooks/remote_puppet_afs.yaml   | 1 +
 playbooks/remote_puppet_else.yaml  | 1 +
 playbooks/remote_puppet_git.yaml   | 4 ++++
 4 files changed, 7 insertions(+)

diff --git a/playbooks/remote_puppet_adhoc.yaml b/playbooks/remote_puppet_adhoc.yaml
index fc11debf07..7c1e182ac2 100644
--- a/playbooks/remote_puppet_adhoc.yaml
+++ b/playbooks/remote_puppet_adhoc.yaml
@@ -5,3 +5,4 @@
   - role: puppet
     manage_config: True
     puppet_reports: none
+    futureparser: "{{ True if 'futureparser' in hostvars[inventory_hostname].group_names else False }}"
diff --git a/playbooks/remote_puppet_afs.yaml b/playbooks/remote_puppet_afs.yaml
index 5657271e0c..7b5cd2ea42 100644
--- a/playbooks/remote_puppet_afs.yaml
+++ b/playbooks/remote_puppet_afs.yaml
@@ -6,3 +6,4 @@
   - role: puppet
     manage_config: True
     puppet_reports: none
+    futureparser: "{{ True if 'futureparser' in hostvars[inventory_hostname].group_names else False }}"
diff --git a/playbooks/remote_puppet_else.yaml b/playbooks/remote_puppet_else.yaml
index 1e6f52dfe6..556dba807e 100644
--- a/playbooks/remote_puppet_else.yaml
+++ b/playbooks/remote_puppet_else.yaml
@@ -5,3 +5,4 @@
   - role: puppet
     manage_config: True
     puppet_reports: none
+    futureparser: "{{ True if 'futureparser' in hostvars[inventory_hostname].group_names else False }}"
diff --git a/playbooks/remote_puppet_git.yaml b/playbooks/remote_puppet_git.yaml
index 2a48f8ef23..e42cac665d 100644
--- a/playbooks/remote_puppet_git.yaml
+++ b/playbooks/remote_puppet_git.yaml
@@ -14,6 +14,7 @@
       copy_puppet: False
       manage_config: True
       puppet_reports: none
+      futureparser: "{{ True if 'futureparser' in hostvars[inventory_hostname].group_names else False }}"
 - hosts: "git0*:!disabled"
   strategy: free
   gather_facts: true
@@ -24,6 +25,7 @@
         project_config_ref: "{{ hostvars.localhost.gitinfo.after }}"
       manage_config: True
       puppet_reports: none
+      futureparser: "{{ True if 'futureparser' in hostvars[inventory_hostname].group_names else False }}"
 - hosts: "review:!disabled"
   strategy: free
   gather_facts: true
@@ -34,6 +36,7 @@
       puppet_timeout: 60m
       manage_config: True
       puppet_reports: none
+      futureparser: "{{ True if 'futureparser' in hostvars[inventory_hostname].group_names else False }}"
 - hosts: "zuul-scheduler:!disabled"
   strategy: free
   gather_facts: true
@@ -44,3 +47,4 @@
       puppet_timeout: 60m
       manage_config: True
       puppet_reports: none
+      futureparser: "{{ True if 'futureparser' in hostvars[inventory_hostname].group_names else False }}"