Compare commits

...

6 Commits
v0.4.0 ... 0.4

Author SHA1 Message Date
Thomas Woerner
17dd8e4ec6 Merge pull request #659 from t-woerner/fix_galaxyfy_module_examples
galaxyfy: Fix newline issue in module examples
2021-10-12 16:40:58 +02:00
Thomas Woerner
0d57d69a99 galaxyfy: Fix newline issue in module examples
The newlines in module examples have been removed due to wrong strip for
the input lines.
2021-10-12 16:18:57 +02:00
Thomas Woerner
d1c3ecc95d Merge pull request #658 from t-woerner/fix_galaxyfy_roles_after_vars
galaxyfy: Fix roles after vars
2021-10-12 15:27:51 +02:00
Thomas Woerner
c92e9a5ca1 galaxyfy: Fix roles after vars
If roles have been used after vars, the name of the role was not changed
as the "vars:" section was turning off changeable. A "roles:" section is
now turning on changeable.
2021-10-12 10:56:58 +02:00
Rafael Guterres Jeffman
be78368eb0 Merge pull request #657 from t-woerner/galaxy_action_fix
build-galaxy-release.sh: Use proper action plugins path plugins/action
2021-10-11 12:57:50 -03:00
Thomas Woerner
7ee6fc3238 build-galaxy-release.sh: Use proper action plugins path plugins/action
The action plugins path was wrong. It was "plugins/action_plugins" and
should have been "plugins/action".
2021-10-11 17:06:17 +02:00
2 changed files with 18 additions and 14 deletions

View File

@@ -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

View File

@@ -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)