mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-27 05:43:05 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17dd8e4ec6 | ||
|
|
0d57d69a99 | ||
|
|
d1c3ecc95d | ||
|
|
c92e9a5ca1 | ||
|
|
be78368eb0 | ||
|
|
7ee6fc3238 |
@@ -23,8 +23,8 @@ sed -i -e "s/ansible.module_utils.ansible_freeipa_module/ansible_collections.${c
|
||||
ln -sf ../../roles/*/library/*.py .
|
||||
})
|
||||
|
||||
[ ! -x plugins/action_plugins ] && mkdir plugins/action_plugins
|
||||
(cd plugins/action_plugins && {
|
||||
[ ! -x plugins/action ] && mkdir plugins/action
|
||||
(cd plugins/action && {
|
||||
ln -sf ../../roles/*/action_plugins/*.py .
|
||||
})
|
||||
|
||||
@@ -85,5 +85,6 @@ rm plugins/module_utils/ansible_ipa_*
|
||||
rm plugins/modules/ipaserver_*
|
||||
rm plugins/modules/ipareplica_*
|
||||
rm plugins/modules/ipaclient_*
|
||||
rm plugins/action_plugins/ipaclient_*
|
||||
rm plugins/action/ipaclient_*
|
||||
rmdir plugins/action
|
||||
git reset --hard
|
||||
|
||||
@@ -24,8 +24,8 @@ import re
|
||||
|
||||
|
||||
def galaxyfy_playbook(project_prefix, collection_prefix, lines):
|
||||
p1 = re.compile('(%s.*:)$' % project_prefix)
|
||||
p2 = re.compile('(.*:) (%s.*)$' % project_prefix)
|
||||
po1 = re.compile('(%s.*:)$' % project_prefix)
|
||||
po2 = re.compile('(.*:) (%s.*)$' % project_prefix)
|
||||
out_lines = []
|
||||
|
||||
pattern1 = r'%s.\1' % collection_prefix
|
||||
@@ -42,23 +42,26 @@ def galaxyfy_playbook(project_prefix, collection_prefix, lines):
|
||||
elif stripped in ["set_fact:", "vars:"]:
|
||||
changeable = False
|
||||
include_role = False
|
||||
elif stripped == "roles:":
|
||||
changeable = True
|
||||
include_role = False
|
||||
elif stripped.startswith("include_role:"):
|
||||
include_role = True
|
||||
elif include_role and stripped.startswith("name:"):
|
||||
line = p2.sub(pattern2, line)
|
||||
line = po2.sub(pattern2, line)
|
||||
changed = True
|
||||
elif changeable and stripped.startswith("- role:"):
|
||||
line = p2.sub(pattern2, line)
|
||||
line = po2.sub(pattern2, line)
|
||||
changed = True
|
||||
elif (changeable and stripped.startswith(project_prefix) and
|
||||
not stripped.startswith(collection_prefix) and
|
||||
stripped.endswith(":")):
|
||||
line = p1.sub(pattern1, line)
|
||||
elif (changeable and stripped.startswith(project_prefix)
|
||||
and not stripped.startswith(collection_prefix) # noqa
|
||||
and stripped.endswith(":")): # noqa
|
||||
line = po1.sub(pattern1, line)
|
||||
changed = True
|
||||
changeable = False # Only change first line in task
|
||||
elif (stripped.startswith("- %s" % project_prefix) and
|
||||
stripped.endswith(":")):
|
||||
line = p1.sub(pattern1, line)
|
||||
elif (stripped.startswith("- %s" % project_prefix)
|
||||
and stripped.endswith(":")): # noqa
|
||||
line = po1.sub(pattern1, line)
|
||||
changed = True
|
||||
|
||||
out_lines.append(line)
|
||||
|
||||
Reference in New Issue
Block a user