From 515f57eb09a486941c15fd80b0d58cd020280ea0 Mon Sep 17 00:00:00 2001
From: Thomas Woerner <twoerner@redhat.com>
Date: Wed, 24 Jul 2019 18:31:05 +0200
Subject: [PATCH] utils/galaxyify-playbook.py: Support to galaxify rule lines
 in playbooks

---
 utils/galaxyify-playbook.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/utils/galaxyify-playbook.py b/utils/galaxyify-playbook.py
index cb1356f4..c2ad6209 100644
--- a/utils/galaxyify-playbook.py
+++ b/utils/galaxyify-playbook.py
@@ -4,7 +4,7 @@ import re
 
 def galaxify_playbook(playbook_in):
     p1 = re.compile('(ipa.*:)$')
-    p2 = re.compile('(name:) (ipa.*)$')
+    p2 = re.compile('(.*:) (ipa.*)$')
     lines = []
 
     with open(playbook_in) as in_f:
@@ -24,6 +24,9 @@ def galaxify_playbook(playbook_in):
             elif include_role and stripped.startswith("name:"):
                 line = p2.sub(r'\1 freeipa.ansible_freeipa.\2', line)
                 changed = True
+            elif changeable and stripped.startswith("- role:"):
+                line = p2.sub(r'\1 freeipa.ansible_freeipa.\2', line)
+                changed = True
             elif changeable and not stripped.startswith(
                     "freeipa.ansible_freeipa."):
                 line = p1.sub(r'freeipa.ansible_freeipa.\1', line)
-- 
GitLab