Skip to content

Commit

Permalink
instance group skip option when creating orgs (#859)
Browse files Browse the repository at this point in the history
* modified:   roles/organizations/defaults/main.yml
	modified:   roles/organizations/tasks/main.yml

* modified:   roles/organizations/tasks/main.yml

* modified:   plugins/lookup/controller_object_diff.py
	modified:   plugins/modules/controller_export_diff.py
	modified:   roles/organizations/tasks/main.yml
  • Loading branch information
djdanielsson authored Jul 9, 2024
1 parent 82c491d commit 23fb36e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions plugins/lookup/controller_object_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
name: infra.controller_configuration.projects
vars:
controller_projects: "{{ project_difference }}"
...
"""

RETURN = """
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/controller_export_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
controller_password: secret123
validate_certs: false
register: export_results
...
"""

import logging
Expand Down
1 change: 1 addition & 0 deletions roles/organizations/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ controller_configuration_organizations_enforce_defaults: "{{ controller_configur
assign_galaxy_credentials_to_org: true
assign_default_ee_to_org: true
assign_notification_templates_to_org: true
assign_instance_groups_to_org: true
...
6 changes: 3 additions & 3 deletions roles/organizations/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
new_name: "{{ __controller_organizations_item.new_name | default(omit) }}"
description: "{{ __controller_organizations_item.description | default(('' if controller_configuration_organizations_enforce_defaults else omit), true) }}"
custom_virtualenv: "{{ __controller_organizations_item.custom_virtualenv | default(omit, true) }}"
max_hosts: "{{ __controller_organizations_item.max_hosts | default(( 0 if controller_configuration_organizations_enforce_defaults else omit), true) }}"
instance_groups: "{{ __controller_organizations_item.instance_groups | default(([] if controller_configuration_organizations_enforce_defaults else omit), true) }}"
max_hosts: "{{ __controller_organizations_item.max_hosts | default((0 if controller_configuration_organizations_enforce_defaults else omit), true) }}"
instance_groups: "{{ (__controller_organizations_item.instance_groups | default(([] if controller_configuration_organizations_enforce_defaults else omit), true)) if (assign_instance_groups_to_org is defined and assign_instance_groups_to_org) else omit }}"
default_environment: "{{ (__controller_organizations_item.default_environment.name | default(__controller_organizations_item.default_environment | default(__controller_organizations_item.execution_environment | default(omit)))) if (assign_default_ee_to_org is defined and assign_default_ee_to_org) else omit }}"
galaxy_credentials: "{{ (__controller_organizations_item.galaxy_credentials | default(([] if controller_configuration_organizations_enforce_defaults else omit), true)) if (assign_galaxy_credentials_to_org is defined and assign_galaxy_credentials_to_org) else omit }}"
notification_templates_approvals: "{{ (__controller_organizations_item.related.notification_templates_approvals | map(attribute='name') | list if __controller_organizations_item.related.notification_templates_approvals is defined) | default(__controller_organizations_item.notification_templates_approvals) | default(([] if controller_configuration_organizations_enforce_defaults else omit), true) if (assign_notification_templates_to_org is defined and assign_notification_templates_to_org) else omit }}"
notification_templates_approvals: "{{ (__controller_organizations_item.related.notification_templates_approvals | map(attribute='name') | list if __controller_organizations_item.related.notification_templates_approvals is defined) | default(__controller_organizations_item.notification_templates_approvals) | default(([] if controller_configuration_organizations_enforce_defaults else omit), true) if (assign_notification_templates_to_org is defined and assign_notification_templates_to_org) else omit }}"
notification_templates_started: "{{ (__controller_organizations_item.related.notification_templates_started | map(attribute='name') | list if __controller_organizations_item.related.notification_templates_started is defined) | default(__controller_organizations_item.notification_templates_started) | default(([] if controller_configuration_organizations_enforce_defaults else omit), true) if (assign_notification_templates_to_org is defined and assign_notification_templates_to_org) else omit }}"
notification_templates_success: "{{ (__controller_organizations_item.related.notification_templates_success | map(attribute='name') | list if __controller_organizations_item.related.notification_templates_success is defined) | default(__controller_organizations_item.notification_templates_success) | default(([] if controller_configuration_organizations_enforce_defaults else omit), true) if (assign_notification_templates_to_org is defined and assign_notification_templates_to_org) else omit }}"
notification_templates_error: "{{ (__controller_organizations_item.related.notification_templates_error | map(attribute='name') | list if __controller_organizations_item.related.notification_templates_error is defined) | default(__controller_organizations_item.notification_templates_error) | default(([] if controller_configuration_organizations_enforce_defaults else omit), true) if (assign_notification_templates_to_org is defined and assign_notification_templates_to_org) else omit }}"
Expand Down

0 comments on commit 23fb36e

Please sign in to comment.