Skip to content

Commit

Permalink
fix broken ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-m-sullivan committed Dec 3, 2023
1 parent 56de8c3 commit 274b43f
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 34 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/credential_owner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- The role 'credentials' have had the enforced defaults removed from team, user, and organization options. This was causing an error with these parameters were mutally exclusive.
...
6 changes: 3 additions & 3 deletions roles/credentials/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
new_name: "{{ __controller_credentials_item.new_name | default(omit, true) }}"
copy_from: "{{ __controller_credentials_item.copy_from | default(omit, true) }}"
description: "{{ __controller_credentials_item.description | default(('' if controller_configuration_credentials_enforce_defaults else omit), true) }}"
organization: "{{ __controller_credentials_item.organization.name | default(__controller_credentials_item.organization | default(('' if controller_configuration_credentials_enforce_defaults else omit), true)) }}"
organization: "{{ __controller_credentials_item.organization.name | default(__controller_credentials_item.organization | default(omit, true)) }}"
credential_type: "{{ __controller_credentials_item.credential_type.name | default(__controller_credentials_item.credential_type | mandatory) }}"
inputs: "{{ __controller_credentials_item.inputs | default(({} if controller_configuration_credentials_enforce_defaults else omit), true) }}"
user: "{{ __controller_credentials_item.user.username | default(__controller_credentials_item.user | default(('' if controller_configuration_credentials_enforce_defaults else omit), true)) }}"
team: "{{ __controller_credentials_item.team.name | default(__controller_credentials_item.team | default(('' if controller_configuration_credentials_enforce_defaults else omit), true)) }}"
user: "{{ __controller_credentials_item.user.username | default(__controller_credentials_item.user | default(omit, true)) }}"
team: "{{ __controller_credentials_item.team.name | default(__controller_credentials_item.team | default(omit, true)) }}"
update_secrets: "{{ __controller_credentials_item.update_secrets | default(true if controller_configuration_credentials_enforce_defaults else omit) }}"
state: "{{ __controller_credentials_item.state | default(controller_state | default('present')) }}"

Expand Down
10 changes: 10 additions & 0 deletions tests/configs/credentials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,14 @@ controller_credentials:
organization: Default
inputs:
username: username
- credential_type: Source Control
name: gitlab-user
team: satellite-qe
inputs:
username: username
- credential_type: Source Control
name: gitlab-team
user: controller_user
inputs:
username: username
...
74 changes: 43 additions & 31 deletions tests/configs_export_model/differential_items.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@
differential_expected:
credential_types: []
credentials:
- credential_type:
kind: scm
name: Source Control
type: credential_type
description: ''
inputs:
username: username
name: gitlab-team
natural_key:
credential_type:
kind: scm
name: Source Control
type: credential_type
name: gitlab-team
organization:
type: credential
organization:
state: absent
user:
type: user
username: controller_user
- credential_type:
kind: scm
name: Source Control
type: credential_type
description: ''
inputs:
username: username
name: gitlab-user
natural_key:
credential_type:
kind: scm
name: Source Control
type: credential_type
name: gitlab-user
organization:
name: Satellite
type: organization
type: credential
organization:
name: Satellite
type: organization
state: absent
- credential_type:
kind: vault
name: Vault
Expand Down Expand Up @@ -262,37 +305,6 @@ differential_expected:
state: absent
organizations: []
projects:
- allow_override: false
credential:
default_environment:
description: ansible-examples
local_path: _10__test_inventory_source_project
name: Test Inventory source project
natural_key:
name: Test Inventory source project
organization:
name: Satellite
type: organization
type: project
organization:
name: Satellite
type: organization
related:
notification_templates_error: []
notification_templates_started: []
notification_templates_success: []
scm_branch: ""
scm_clean: false
scm_delete_on_update: false
scm_refspec: ""
scm_track_submodules: false
scm_type: git
scm_update_cache_timeout: 0
scm_update_on_launch: false
scm_url: https://github.com/ansible/ansible-examples.git
signature_validation_credential:
state: absent
timeout: 0
- allow_override: false
credential:
credential_type:
Expand Down
7 changes: 7 additions & 0 deletions tests/configs_export_model/projects_export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,11 @@ projects:
description: Test Project 2
organization:
name: Default
- name: Test Inventory source project
description: ansible-examples
organization:
name: Satellite
type: organization
scm_type: git
scm_url: https://github.com/ansible/ansible-examples.git
...

0 comments on commit 274b43f

Please sign in to comment.