mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
The module action group <collection-prefix>.modules is created
automatically while building the galaxy release.
The action group can be used for module_defaults in this way:
module_defauls:
group/<collection-prefix>.modules:
ipaadmin_password: SomeADMINpassword
Example:
module_defaults:
group/freeipa.ansible_freeipa.modules:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
collections:
- freeipa.ansible_freeipa
25 lines
633 B
Python
25 lines
633 B
Python
import sys
|
|
import yaml
|
|
from facts import MANAGEMENT_MODULES
|
|
|
|
|
|
def create_action_group(yml_file, project_prefix):
|
|
yaml_data = None
|
|
with open(yml_file) as f_in:
|
|
yaml_data = yaml.safe_load(f_in)
|
|
|
|
yaml_data.setdefault("action_groups", {})[
|
|
"%s.modules" % project_prefix
|
|
] = MANAGEMENT_MODULES
|
|
|
|
with open(yml_file, 'w') as f_out:
|
|
yaml.safe_dump(yaml_data, f_out, default_flow_style=False,
|
|
explicit_start=True)
|
|
|
|
|
|
if len(sys.argv) != 3:
|
|
print("Usage: %s <runtime file> <collection prefix>" % sys.argv[0])
|
|
sys.exit(-1)
|
|
|
|
create_action_group(sys.argv[1], sys.argv[2])
|