Skip to content
Snippets Groups Projects
Commit 515f57eb authored by Thomas Woerner's avatar Thomas Woerner
Browse files

utils/galaxyify-playbook.py: Support to galaxify rule lines in playbooks

parent 62097ee3
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ import re ...@@ -4,7 +4,7 @@ import re
def galaxify_playbook(playbook_in): def galaxify_playbook(playbook_in):
p1 = re.compile('(ipa.*:)$') p1 = re.compile('(ipa.*:)$')
p2 = re.compile('(name:) (ipa.*)$') p2 = re.compile('(.*:) (ipa.*)$')
lines = [] lines = []
with open(playbook_in) as in_f: with open(playbook_in) as in_f:
...@@ -24,6 +24,9 @@ def galaxify_playbook(playbook_in): ...@@ -24,6 +24,9 @@ def galaxify_playbook(playbook_in):
elif include_role and stripped.startswith("name:"): elif include_role and stripped.startswith("name:"):
line = p2.sub(r'\1 freeipa.ansible_freeipa.\2', line) line = p2.sub(r'\1 freeipa.ansible_freeipa.\2', line)
changed = True 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( elif changeable and not stripped.startswith(
"freeipa.ansible_freeipa."): "freeipa.ansible_freeipa."):
line = p1.sub(r'freeipa.ansible_freeipa.\1', line) line = p1.sub(r'freeipa.ansible_freeipa.\1', line)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment