From db95089922a14f1efe64ae5ca10368a93016a906 Mon Sep 17 00:00:00 2001 From: adonisgarciac Date: Fri, 23 Jun 2023 11:13:33 +0200 Subject: [PATCH] #626 remove depencency of CONTROLER_USERNAME variable for object_diff role --- roles/object_diff/tasks/hosts.yml | 3 +-- roles/object_diff/tasks/instance_groups.yml | 3 +-- roles/object_diff/tasks/organizations.yml | 3 +-- roles/object_diff/tasks/roles.yml | 3 +-- roles/object_diff/tasks/teams.yml | 3 +-- roles/object_diff/tasks/user_accounts.yml | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/roles/object_diff/tasks/hosts.yml b/roles/object_diff/tasks/hosts.yml index 5465bd9f6..19462db98 100644 --- a/roles/object_diff/tasks/hosts.yml +++ b/roles/object_diff/tasks/hosts.yml @@ -14,8 +14,7 @@ 'has_inventory_sources': 'false', 'not__total_hosts': '0', 'not__kind': 'smart'}, - host=controller_hostname, username=controller_username, - oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs, + host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs, return_all=true, max_objects=query_controller_api_max_objects) }}" no_log: "{{ controller_configuration_object_diff_secure_logging }}" diff --git a/roles/object_diff/tasks/instance_groups.yml b/roles/object_diff/tasks/instance_groups.yml index 2a3400067..d67512439 100644 --- a/roles/object_diff/tasks/instance_groups.yml +++ b/roles/object_diff/tasks/instance_groups.yml @@ -1,8 +1,7 @@ --- - name: "Get the current controller user to determine if it is super-admin" ansible.builtin.set_fact: - __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'users', - query_params={'username': controller_username}, + __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'me', host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) }}" diff --git a/roles/object_diff/tasks/organizations.yml b/roles/object_diff/tasks/organizations.yml index 33589b654..a2c522c08 100644 --- a/roles/object_diff/tasks/organizations.yml +++ b/roles/object_diff/tasks/organizations.yml @@ -1,8 +1,7 @@ --- - name: "Get the current controller user to determine if it is super-admin" ansible.builtin.set_fact: - __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'users', - query_params={'username': controller_username}, + __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'me', host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) }}" no_log: "{{ controller_configuration_object_diff_secure_logging }}" diff --git a/roles/object_diff/tasks/roles.yml b/roles/object_diff/tasks/roles.yml index 34eb7f639..61e44ea67 100644 --- a/roles/object_diff/tasks/roles.yml +++ b/roles/object_diff/tasks/roles.yml @@ -1,8 +1,7 @@ --- - name: "Get the current controller user to determine if it is super-admin" ansible.builtin.set_fact: - __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'users', - query_params={'username': controller_username}, + __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'me', host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) }}" no_log: "{{ controller_configuration_object_diff_secure_logging }}" diff --git a/roles/object_diff/tasks/teams.yml b/roles/object_diff/tasks/teams.yml index b05972677..9d35607d0 100644 --- a/roles/object_diff/tasks/teams.yml +++ b/roles/object_diff/tasks/teams.yml @@ -1,8 +1,7 @@ --- - name: "Get the current controller user to determine if it is super-admin" ansible.builtin.set_fact: - __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'users', - query_params={'username': controller_username}, + __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'me', host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) }}" no_log: "{{ controller_configuration_object_diff_secure_logging }}" diff --git a/roles/object_diff/tasks/user_accounts.yml b/roles/object_diff/tasks/user_accounts.yml index 80050bf8d..5395c72a5 100644 --- a/roles/object_diff/tasks/user_accounts.yml +++ b/roles/object_diff/tasks/user_accounts.yml @@ -2,8 +2,7 @@ # tasks file for controller_ldap_settings - name: "Get the current controller user to determine if it is super-admin" ansible.builtin.set_fact: - __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'users', - query_params={'username': controller_username}, + __controller_api_current_user_check_is_admin: "{{ lookup(controller_api_plugin, 'me', host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs) }}" no_log: "{{ controller_configuration_object_diff_secure_logging }}"