mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-30 11:24:50 +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):
|
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):
|
|||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user