Skip to content

Commit

Permalink
Merge pull request #10 from zerwes/prefer-builtin
Browse files Browse the repository at this point in the history
give precedence to ansible modules
  • Loading branch information
zerwes committed Sep 19, 2022
2 parents 2dd84ff + fa07744 commit 000bdd3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@
notify: restart-xyz
when: of_local_json

- name: test user ... expect buildin
user:
name: test
password: '!'
5 changes: 5 additions & 0 deletions exampleconverted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,8 @@
notify: restart-xyz
when: of_local_json

- name: test user ... expect buildin
# possible ambiguous replacement: user : ansible.builtin.user | awx.awx.user | inspur.sm.user | sensu.sensu_go.user | theforeman.foreman.user
ansible.builtin.user:
name: test
password: '!'
6 changes: 5 additions & 1 deletion fqcn-fixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ def increase_indent(self, flow=False, *dargs, **dkwargs): # pylint: disable=keyw
if nonfqcn not in fqcndict.keys():
fqcndict[nonfqcn] = []
if fqcn not in fqcndict[nonfqcn]:
fqcndict[nonfqcn].append(fqcn)
# this defines the precedence of the replacements made
if fqcn.startswith('ansible.'):
fqcndict[nonfqcn].insert(0, fqcn)
else:
fqcndict[nonfqcn].append(fqcn)
print('%s : %s -> %s' % (modname, nonfqcn, fqcn))
with open(args.fqcnmapfile, "w", encoding="utf-8") as fqcnmapfile:
fqcnmapfile.write(
Expand Down
6 changes: 3 additions & 3 deletions fqcn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2183,8 +2183,8 @@ cli_config:
cli_credential:
- cisco.dnac.cli_credential
cli_parse:
- ansible.netcommon.cli_parse
- ansible.utils.cli_parse
- ansible.netcommon.cli_parse
client_detail_info:
- cisco.dnac.client_detail_info
client_enrichment_details_info:
Expand Down Expand Up @@ -7491,8 +7491,8 @@ grafana_team:
grafana_user:
- community.grafana.grafana_user
group:
- awx.awx.group
- ansible.builtin.group
- awx.awx.group
group_assignment:
- openstack.cloud.group_assignment
group_by:
Expand Down Expand Up @@ -12687,11 +12687,11 @@ uri:
urpmi:
- community.general.urpmi
user:
- ansible.builtin.user
- awx.awx.user
- inspur.sm.user
- sensu.sensu_go.user
- theforeman.foreman.user
- ansible.builtin.user
user_enrichment_details_info:
- cisco.dnac.user_enrichment_details_info
user_group:
Expand Down

0 comments on commit 000bdd3

Please sign in to comment.