diff --git a/changelogs/fragments/licence_org.yml b/changelogs/fragments/licence_org.yml new file mode 100644 index 000000000..b1d3e2f6d --- /dev/null +++ b/changelogs/fragments/licence_org.yml @@ -0,0 +1,7 @@ +--- +bugfixes: + - Fixed issue with organization role not acceppting default environments option correctly. + - Fixed issue with licence role not operating properly, when a controller never had credentials provided for subscription lookup. See Role Readme for proper usuage. +minor_changes: + - licence role now uses a boolean of controller_license.use_looup to determine whether to lookup subscriptions. A lookup is only needed to refresh the available pools, or if it has never been done. See Role Readme for details. +... diff --git a/roles/ad_hoc_command/README.md b/roles/ad_hoc_command/README.md index 6b703cf87..6ff703ae4 100644 --- a/roles/ad_hoc_command/README.md +++ b/roles/ad_hoc_command/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/ad_hoc_command_cancel/README.md b/roles/ad_hoc_command_cancel/README.md index c6e706543..c9aeea5f7 100644 --- a/roles/ad_hoc_command_cancel/README.md +++ b/roles/ad_hoc_command_cancel/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/applications/README.md b/roles/applications/README.md index f36cbcff1..30de31159 100644 --- a/roles/applications/README.md +++ b/roles/applications/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/bulk_host_create/README.md b/roles/bulk_host_create/README.md index bf9e7a19d..6a92b00fb 100644 --- a/roles/bulk_host_create/README.md +++ b/roles/bulk_host_create/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_hostname`|""|yes|URL to the Ansible Controller Server.|127.0.0.1| diff --git a/roles/bulk_job_launch/README.md b/roles/bulk_job_launch/README.md index ca8656348..034ca0dc9 100644 --- a/roles/bulk_job_launch/README.md +++ b/roles/bulk_job_launch/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/credential_input_sources/README.md b/roles/credential_input_sources/README.md index b321cadf2..3e822d4c7 100644 --- a/roles/credential_input_sources/README.md +++ b/roles/credential_input_sources/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/credential_types/README.md b/roles/credential_types/README.md index a16e9be74..95b59a1f8 100644 --- a/roles/credential_types/README.md +++ b/roles/credential_types/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/credentials/README.md b/roles/credentials/README.md index 0c8dd2e73..bc6a44a8c 100644 --- a/roles/credentials/README.md +++ b/roles/credentials/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/execution_environments/README.md b/roles/execution_environments/README.md index 2481cbab3..a3860e73e 100644 --- a/roles/execution_environments/README.md +++ b/roles/execution_environments/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/groups/README.md b/roles/groups/README.md index 1ae23adab..f2eb212d1 100644 --- a/roles/groups/README.md +++ b/roles/groups/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/hosts/README.md b/roles/hosts/README.md index fc301455d..02ba0bc5a 100644 --- a/roles/hosts/README.md +++ b/roles/hosts/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/instance_groups/README.md b/roles/instance_groups/README.md index b7bdb48ef..5823d3334 100644 --- a/roles/instance_groups/README.md +++ b/roles/instance_groups/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/instances/README.md b/roles/instances/README.md index 10c9a4252..7258ab7fe 100644 --- a/roles/instances/README.md +++ b/roles/instances/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/inventories/README.md b/roles/inventories/README.md index 48eeab8ee..2790e8e1c 100644 --- a/roles/inventories/README.md +++ b/roles/inventories/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/inventory_source_update/README.md b/roles/inventory_source_update/README.md index 82812519d..d484d898d 100644 --- a/roles/inventory_source_update/README.md +++ b/roles/inventory_source_update/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/inventory_sources/README.md b/roles/inventory_sources/README.md index 663b9f358..703f62b12 100644 --- a/roles/inventory_sources/README.md +++ b/roles/inventory_sources/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/job_launch/README.md b/roles/job_launch/README.md index 1466bcc93..c5650bab0 100644 --- a/roles/job_launch/README.md +++ b/roles/job_launch/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/job_templates/README.md b/roles/job_templates/README.md index ea158bc91..9287e681a 100644 --- a/roles/job_templates/README.md +++ b/roles/job_templates/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/jobs_cancel/README.md b/roles/jobs_cancel/README.md index 9c9c41e47..c46cc008a 100644 --- a/roles/jobs_cancel/README.md +++ b/roles/jobs_cancel/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/labels/README.md b/roles/labels/README.md index 29d7201fd..e49776e7f 100644 --- a/roles/labels/README.md +++ b/roles/labels/README.md @@ -12,8 +12,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/license/README.md b/roles/license/README.md index c7f16078b..b7c76d3a2 100644 --- a/roles/license/README.md +++ b/roles/license/README.md @@ -4,6 +4,8 @@ An Ansible Role to deploy a license on Ansible Controller. +This will either accept a manifest file, or use redhat subscription account credentials to lookup available subscriptions and use them. + ## Requirements ansible-galaxy collection install -r tests/collections/requirements.yml to be installed @@ -14,8 +16,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| @@ -25,6 +25,8 @@ Currently: |`controller_password`|""|no|Controller Admin User's password on the Ansible Controller Server. This should be stored in an Ansible Vault at vars/controller-secrets.yml or elsewhere and called from a parent playbook. Either username / password or oauthtoken need to be specified.|| |`controller_oauthtoken`|""|no|Controller Admin User's token on the Ansible Controller Server. This should be stored in an Ansible Vault at or elsewhere and called from a parent playbook. Either username / password or oauthtoken need to be specified.||| |`controller_license`|`see below`|yes|Data structure describing your license for controller, described below.|| +|`redhat_subscription_username`|""|no|Red Hat or Red Hat Satellite username to get available subscriptions. Used only for Subscription lookup implementation.| +|`redhat_subscription_password`|""|no|Red Hat or Red Hat Satellite password to get available subscriptions. Used only for Subscription lookup implementation.| ### Secure Logging Variables @@ -59,23 +61,18 @@ The module and this role can use either a manifest file, or lookup the subscript |`force`|`False`|no|bool|By default, the license manifest will only be applied if controller is currently unlicensed or trial licensed. When force=true, the license is always applied.| |`state`|`present`|no|str|Desired state of the resource.| -For further details on fields see - ### License Variables for using Red Hat Subscription |Variable Name|Default Value|Required|Type|Description| |:---:|:---:|:---:|:---:|:---:| -|`redhat_subscription_username`|""|no|str|Red Hat or Red Hat Satellite username to get available subscriptions.| -|`redhat_subscription_password`|""|no|str|Red Hat or Red Hat Satellite password to get available subscriptions.| |`filters`|"default values"|no|str|dict of filters to use to narrow the subscription. See example below for how to use this.| |`support_level`|"Self-Support"|no|str|DEPRECATED - changed to `manifest_file` (still works as an alias)| |`list_num`|0|no|int|List index of the subscription to use, if you want to overide the default, it is recomended to use the filters to limit the pools found.| -|`pool_id`|""|no|str|Red Hat or Red Hat Satellite pool_id to attach to, setting this will skip the lookup.| +|`pool_id`|""|no|str|Red Hat or Red Hat Satellite pool_id to attach to.| |`force`|`False`|no|bool|By default, the license will only be applied if controller is currently unlicensed or trial licensed. When force=true, the license is always applied.| +|`use_lookup`|`False`|no|bool|Whether or not to lookup subscriptions.| |`state`|`present`|no|str|Desired state of the resource.| -For further details on fields see - ### Standard Project Data Structure #### Json Example @@ -137,7 +134,10 @@ controller_license: controller_password: changeme redhat_subscription_username: changeme redhat_subscription_password: changeme - + controller_license: + filters: + product_name: "Red Hat Ansible Automation Platform" + support_level: "Self-Support" roles: - {role: infra.controller_configuration.license} ``` diff --git a/roles/license/meta/argument_specs.yml b/roles/license/meta/argument_specs.yml index f0851624b..3040dd82f 100644 --- a/roles/license/meta/argument_specs.yml +++ b/roles/license/meta/argument_specs.yml @@ -4,10 +4,9 @@ argument_specs: short_description: An Ansible Role to deploy a license on Ansible Controller. options: - controller_labels: + controller_license: description: Data structure describing your license for Controller - type: list - elements: dict + type: dict # options: # manifest_file: # required: false @@ -46,6 +45,23 @@ argument_specs: # required: false # type: bool # description: By default, the license manifest will only be applied if controller is currently unlicensed or trial licensed. When force=true, the license is always applied. + # use_lookup: + # default: false + # required: false + # type: bool + # description: Whether or not to lookup subscriptions. + + # Variables used for Liscense lookup + redhat_subscription_username: + default: None + required: false + type: str + description: Red Hat or Red Hat Satellite username to get available subscriptions. + redhat_subscription_password: + default: None + required: false + type: str + description: Red Hat or Red Hat Satellite password to get available subscriptions. # No_log variables controller_configuration_labels_secure_logging: diff --git a/roles/license/tasks/subscription.yml b/roles/license/tasks/subscription.yml index 92350cf84..64bb26b21 100644 --- a/roles/license/tasks/subscription.yml +++ b/roles/license/tasks/subscription.yml @@ -14,7 +14,9 @@ controller_config_file: "{{ controller_config_file | default(omit, true) }}" validate_certs: "{{ controller_validate_certs | default(omit) }}" register: subscription - when: controller_license.pool_id is not defined + when: + - "'use_lookup' in controller_license" + - controller_license.use_lookup - name: Install the Controller license license: diff --git a/roles/notification_templates/README.md b/roles/notification_templates/README.md index 2f68854cd..db57ff8ae 100644 --- a/roles/notification_templates/README.md +++ b/roles/notification_templates/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/organizations/README.md b/roles/organizations/README.md index 208051bb9..0992d9edd 100644 --- a/roles/organizations/README.md +++ b/roles/organizations/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/organizations/tasks/main.yml b/roles/organizations/tasks/main.yml index 5e645db1d..5a43bc906 100644 --- a/roles/organizations/tasks/main.yml +++ b/roles/organizations/tasks/main.yml @@ -6,7 +6,7 @@ custom_virtualenv: "{{ __controller_organizations_item.custom_virtualenv | default(omit, true) }}" max_hosts: "{{ __controller_organizations_item.max_hosts | default(omit, true) }}" instance_groups: "{{ __controller_organizations_item.instance_groups | default(( [] if controller_configuration_organizations_enforce_defaults else omit), true) }}" - default_environment: "{{ (__controller_organizations_item.default_environment.name | default(__controller_organizations_item.execution_environment | default(omit))) if (assign_default_ee_to_org is defined and assign_default_ee_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) }}" 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) }}" diff --git a/roles/project_update/README.md b/roles/project_update/README.md index 5cd84b7a0..cc3dca597 100644 --- a/roles/project_update/README.md +++ b/roles/project_update/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/projects/README.md b/roles/projects/README.md index 18bbdb57b..1c1aec1f9 100644 --- a/roles/projects/README.md +++ b/roles/projects/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|str|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/roles/README.md b/roles/roles/README.md index 80fe6d1a0..fcf5b284c 100644 --- a/roles/roles/README.md +++ b/roles/roles/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/schedules/README.md b/roles/schedules/README.md index 887ecd065..6ab6d468e 100644 --- a/roles/schedules/README.md +++ b/roles/schedules/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/settings/README.md b/roles/settings/README.md index d8e46d806..7ec268ec1 100644 --- a/roles/settings/README.md +++ b/roles/settings/README.md @@ -12,8 +12,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/teams/README.md b/roles/teams/README.md index f553cd46a..89795439c 100644 --- a/roles/teams/README.md +++ b/roles/teams/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/users/README.md b/roles/users/README.md index 55bc283b1..965a2a5fd 100644 --- a/roles/users/README.md +++ b/roles/users/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/workflow_job_templates/README.md b/roles/workflow_job_templates/README.md index 9c5e450a0..8c95a0e3b 100644 --- a/roles/workflow_job_templates/README.md +++ b/roles/workflow_job_templates/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| diff --git a/roles/workflow_launch/README.md b/roles/workflow_launch/README.md index ca85e5ebe..480c166bd 100644 --- a/roles/workflow_launch/README.md +++ b/roles/workflow_launch/README.md @@ -14,8 +14,6 @@ Currently: ## Variables -### Authentication - |Variable Name|Default Value|Required|Description|Example| |:---|:---:|:---:|:---|:---| |`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'|