Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelogs/fragments/object_diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- fix global execution environments comparison and exportation. Update the filetree_create role acordingly.
...
7 changes: 7 additions & 0 deletions plugins/lookup/controller_object_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ def run(self, terms, variables=None, **kwargs):
item.update({"unified_job_template": item["summary_fields"]["unified_job_template"]["name"]})
item.update({"workflow_job_template": item["summary_fields"]["workflow_job_template"]["name"]})
item.pop("summary_fields")
elif api_list[0]["type"] == "execution_environment":
for item in api_list_reduced:
if 'organization' in item['summary_fields']:
item.update({"organization": item['summary_fields']['organization']['name']})
else:
item.update({"organization": None})
item.pop("summary_fields")
elif api_list[0]["type"] == "schedule":
for item in api_list_reduced:
item.update({"unified_job_template": item["summary_fields"]["unified_job_template"]["name"]})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
---
controller_execution_environments: {{ [] if current_execution_environments_asset_value | length == 0 }}
{% for ee in current_execution_environments_asset_value %}
{% if organization_filter is not defined or (ee.summary_fields.organization is defined and ee.summary_fields.organization.name is match(organization_filter)) %}
{% if organization_filter is not defined or (ee.summary_fields.organization is defined and ee.summary_fields.organization.name is match(organization_filter)) %}
- name: "{{ ee.name }}"
description: !unsafe '{{ template_overrides_resources.ee[ee.name].description
| default(template_overrides_global.ee.description)
| default(ee.description) | regex_replace("'", "''") }}'
{% if ee.summary_fields.organization.name is defined %}
{% if ee.summary_fields.organization.name is defined %}
organization: "{{ ee.summary_fields.organization.name }}"
{% endif %}
{% else %}
organization: # Leave this empty organization to let the object_diff role to work properly
{% endif %}
image: "{{ template_overrides_resources.ee[ee.name].image
| default(template_overrides_global.ee.image)
| default(ee.image) }}"
pull: "{{ template_overrides_resources.ee[ee.name].pull
| default(template_overrides_global.ee.pull)
| default(ee.pull) }}"
{% if template_overrides_resources.ee[ee.name].credential is defined
{% if template_overrides_resources.ee[ee.name].credential is defined
or template_overrides_global.ee.credential is defined
or ee.summary_fields.credential is defined %}
credential: "{{ template_overrides_resources.ee[ee.name].credential
| default(template_overrides_global.ee.credential)
| default(ee.summary_fields.credential.name) }}"
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
...
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
---
- name: "Block to be executed only when connected against an AAP instance (not Tower)"
- name: "Block to be executed only when connected against an AAP instance"
block:
- name: Get the organization ID
ansible.builtin.set_fact:
__controller_organization_id: "{{ lookup('ansible.platform.gateway_api', 'api/controller/' + controller_api_version + '/organizations',
query_params={'name': orgs},
host=aap_hostname, oauth_token=aap_oauthtoken, verify_ssl=aap_validate_certs)
}}"
when:
- orgs is defined
- orgs | length > 0

- name: "Get the API list of all Execution Environments in Organization {{ orgs }}"
ansible.builtin.set_fact:
__controller_api_execution_environments: "{{ query('ansible.platform.gateway_api', 'api/controller/' + controller_api_version + '/execution_environments',
query_params={'organization': __controller_organization_id.id},
query_params={'organization': __controller_organization_id.id} if __controller_organization_id is defined else {},
host=aap_hostname, oauth_token=aap_oauthtoken, verify_ssl=aap_validate_certs,
return_all=true, max_objects=query_controller_api_max_objects)
}}"
Expand Down
Loading