Skip to content

Commit

Permalink
Merge pull request redhat-cop#449 from automationiberia/fix_bug_objdi…
Browse files Browse the repository at this point in the history
…ff_orgs

fix bug variable name obj diff orgs
  • Loading branch information
ivarmu authored and sean-m-sullivan committed Dec 17, 2022
2 parents a0c92f9 + 38d5f1a commit 1cac67b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/update_pre_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ name: Update pre-commit configuration


on:
pull_request:
push:
schedule:
- cron: "0 5 * * *"

jobs:
pre-commit:
uses: "redhat-cop/ansible_collections_tooling/.github/workflows/update_precommit.yml@main"
uses: "sean-m-sullivan/ansible_collections_tooling/.github/workflows/update_precommit.yml@main"
with:
github_actor: ${{ github.actor }}
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
# types:
# - yaml
- repo: 'https://github.com/ansible-community/ansible-lint.git'
rev: v6.10.0
rev: v6.9.1
hooks:
# see discussions here about what arguments are used, and behavior
# https://github.com/ansible/ansible-lint/issues/649
Expand Down
4 changes: 2 additions & 2 deletions roles/ad_hoc_command/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# Run Ad Hoc Commands
- name: Run Controller ad hoc command
ad_hoc_command:
- name: Run {{controller_password}}Controller ad hoc command #asd
ad_hoc_commands:
job_type: "{{ __ad_hoc_command_item.job_type | default('run') }}"
inventory: "{{ __ad_hoc_command_item.inventory }}"
limit: "{{ __ad_hoc_command_item.limit | default(omit, true) }}"
Expand Down
20 changes: 11 additions & 9 deletions roles/object_diff/tasks/organizations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
with_present=false, set_absent=true)
}}"

- name: "Set list __list_orgs_empty when protect_not_empty_orgs"
- name: "Set list __list_empty_orgs when protect_not_empty_orgs"
ansible.builtin.set_fact:
__list_empty_orgs: "{{ __list_empty_orgs | default([]) + [__organizations_difference_list_empty_item.name] }}"
loop: "{{ __organizations_difference }}"
Expand All @@ -32,19 +32,19 @@
when:
- protect_not_empty_orgs is defined
- protect_not_empty_orgs
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__org.name | urlencode) + '/users/',
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__organizations_difference_list_empty_item.name | urlencode) + '/users/',
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) | length == 0
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__org.name | urlencode) + '/admins/',
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__organizations_difference_list_empty_item.name | urlencode) + '/admins/',
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) | length == 0
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__org.name | urlencode) + '/inventories/',
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__organizations_difference_list_empty_item.name | urlencode) + '/inventories/',
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) | length == 0
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__org.name | urlencode) + '/teams/',
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__organizations_difference_list_empty_item.name | urlencode) + '/teams/',
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) | length == 0
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__org.name | urlencode) + '/projects/',
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__organizations_difference_list_empty_item.name | urlencode) + '/projects/',
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) | length == 0
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__org.name | urlencode) + '/job_templates/',
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__organizations_difference_list_empty_item.name | urlencode) + '/job_templates/',
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) | length == 0
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__org.name | urlencode) + '/workflow_job_templates/',
- query(controller_api_plugin, 'api/' + controller_api_version + '/organizations/' + (__organizations_difference_list_empty_item.name | urlencode) + '/workflow_job_templates/',
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) | length == 0

- name: "Set Organization differences"
Expand All @@ -53,7 +53,9 @@
loop: "{{ __organizations_difference }}"
loop_control:
loop_var: __organizations_difference_item
when: __organizations_difference is defined and (protect_not_empty_orgs is not defined or not protect_not_empty_orgs or __organizations_difference_item.name in __list_empty_orgs)
when:
- __organizations_difference is defined
- protect_not_empty_orgs is not defined or not protect_not_empty_orgs or (__list_empty_orgs is defined and __organizations_difference_item.name in __list_empty_orgs)

- name: "Set organization's list to be configured"
ansible.builtin.set_fact:
Expand Down

0 comments on commit 1cac67b

Please sign in to comment.