Skip to content
Snippets Groups Projects
Select Git revision
  • 1fde1764af6c9bc63fa1ff7dbd65a53948f9085d
  • master default protected
  • v1.14.7
  • v1.14.6
  • v1.14.5
  • v1.14.4
  • v1.14.3
  • v1.14.2
  • v1.14.1
  • v1.14.0
  • v1.13.2
  • v1.13.1
  • v1.13.0
  • v1.12.1
  • v1.12.0
  • v1.11.1
  • v1.11.0
  • v1.10.0
  • v1.9.2
  • v1.9.1
  • v1.9.0
  • v1.8.4
22 results

create_action_group.py

Blame
  • user avatar
    Thomas Woerner authored
    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
    966797db
    History
    create_action_group.py 633 B
    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])