mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-06 13:23:14 +00:00
utils/galaxyify-playbook.py: Support to galaxify rule lines in playbooks
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user