Skip to content

Commit 3e34350

Browse files
Clean HEAD
1 parent 49af8cd commit 3e34350

File tree

55 files changed

+1073
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1073
-212
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ test
77
tests/output
88
.vscode
99
ansible.cfg
10-
tests/localtest.yml
10+
tests/localtest.yml

roles/dispatch/defaults/main.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,39 +125,35 @@ controller_configuration_dispatcher_roles:
125125
assign_notification_templates_to_org: true
126126
- role: controller_projects
127127
var: controller_projects
128-
tags:
128+
tags:
129129
- inventories
130130
- projects
131131
- role: controller_inventories
132132
var: controller_inventories
133133
tags: inventories
134134
- role: controller_inventory_sources
135135
var: controller_inventory_sources
136-
tags: inventory_sources
137-
tags:
136+
tags:
138137
- inventories
139138
- inventory_sources
140139
- role: controller_inventory_source_update
141140
var: controller_inventory_sources
142-
tags: inventory_sources
143-
tags:
141+
tags:
144142
- inventories
145143
- inventory_sources
146144
- role: controller_hosts
147145
var: controller_hosts
148-
tags: hosts
149-
tags:
146+
tags:
150147
- inventories
151148
- hosts
152149
- role: controller_bulk_host_create
153150
var: controller_bulk_hosts
154-
tags: bulk_hosts
155-
tags:
151+
tags:
156152
- inventories
157153
- bulk_hosts
158154
- role: controller_host_groups
159155
var: controller_groups
160-
tags:
156+
tags:
161157
- inventories
162158
- host_groups
163159
- role: controller_job_templates

roles/eda_controller_tokens/README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# infra.eda_configuration.controller_token
1+
# infra.eda_configuration.eda_controller_tokens
22

33
## Description
44

@@ -8,27 +8,27 @@ Note that tokens cannot be updated, only created.
88
## Variables
99

1010
|Variable Name|Default Value|Required|Description|Example|
11-
|:---:|:---:|:---:|:---:|:---:|
12-
|`eda_host`|""|yes|URL to the EDA Controller (alias: `eda_hostname`)|127.0.0.1|
13-
|`aap_username`|""|yes|Admin User on the Ansible Automation Platform Server. Either username / password or oauthtoken need to be specified.||
14-
|`aap_password`|""|yes|Platform Admin User's password on the EDA Controller Server. This should be stored in an Ansible Vault at vars/platform-secrets.yml or elsewhere and called from a parent playbook.||
15-
|`aap_validate_certs`|`False`|no|Whether or not to validate the Ansible Automation Platform Server's SSL certificate.||
16-
|`aap_request_timeout`|`10`|no|Specify the timeout Ansible should use in requests to the Automation Platform host.||
17-
|`aap_configuration_async_dir`|`null`|no|Sets the directory to write the results file for async tasks. The default value is set to `null` which uses the Ansible Default of `/root/.ansible_async/`.||
18-
|`aap_request_timeout`|`10`|no|Specify the timeout in seconds Ansible should use in requests to the Ansible Automation Platform host.||
19-
|`eda_controller_tokens`|`see below`|yes|Data structure describing your user tokens, described below.||
11+
|:---|:---:|:---:|:---|:---|
12+
|`platform_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'|
13+
|`aap_hostname`|""|yes|URL to the Ansible Automation Platform Server.|127.0.0.1|
14+
|`aap_validate_certs`|`True`|no|Whether or not to validate the Ansible Automation Platform Server's SSL certificate.||
15+
|`aap_username`|""|no|Admin User on the Ansible Automation Platform Server. Either username / password or oauthtoken need to be specified.||
16+
|`aap_password`|""|no|Platform Admin User's password on the Server. This should be stored in an Ansible Vault at vars/platform-secrets.yml or elsewhere and called from a parent playbook.||
17+
|`aap_token`|""|no|Controller Admin User's token on the Ansible Automation Platform 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.||
18+
|`aap_request_timeout`|`10`|no|Specify the timeout in seconds Ansible should use in requests to the controller host.||
19+
|`eda_controller_tokens`|`see below`|yes|Data structure describing your users Described below.||
2020

2121
### Secure Logging Variables
2222

23-
The following Variables complement each other.
23+
The following Variables compliment each other.
2424
If Both variables are not set, secure logging defaults to false.
25-
The role defaults to False as normally the add project task does not include sensitive information.
26-
eda_configuration_user_token_secure_logging defaults to the value of aap_configuration_secure_logging if it is not explicitly called. This allows for secure logging to be toggled for the entire suite of EDA Controller configuration roles with a single variable, or for the user to selectively use it.
25+
The role defaults to False as normally the add group_roles task does not include sensitive information.
26+
eda_configuration_users_secure_logging defaults to the value of aap_configuration_secure_logging if it is not explicitly called. This allows for secure logging to be toggled for the entire suite of automation hub configuration roles with a single variable, or for the user to selectively use it.
2727

2828
|Variable Name|Default Value|Required|Description|
2929
|:---:|:---:|:---:|:---:|
30-
|`eda_configuration_user_token_secure_logging`|`False`|no|Whether or not to include the sensitive Project role tasks in the log. Set this value to `True` if you will be providing your sensitive values from elsewhere.|
31-
|`aap_configuration_secure_logging`|`False`|no|This variable enables secure logging as well, but is shared across multiple roles, see above.|
30+
|`eda_configuration_users_secure_logging`|`False`|no|Whether or not to include the sensitive Registry role tasks in the log. Set this value to `True` if you will be providing your sensitive values from elsewhere.|
31+
|`aap_configuration_secure_logging`|`False`|no|Whether or not to include the sensitive Registry role tasks in the log. Set this value to `True` if you will be providing your sensitive values from elsewhere.|
3232

3333
### Asynchronous Retry Variables
3434

@@ -40,9 +40,12 @@ This also speeds up the overall role.
4040
|Variable Name|Default Value|Required|Description|
4141
|:---:|:---:|:---:|:---:|
4242
|`aap_configuration_async_retries`|50|no|This variable sets the number of retries to attempt for the role globally.|
43-
|`eda_configuration_user_token_async_retries`|`aap_configuration_async_retries`|no|This variable sets the number of retries to attempt for the role.|
44-
|`eda_configuration_async_delay`|1|no|This sets the delay between retries for the role globally.|
45-
|`eda_configuration_user_token_async_delay`|`eda_configuration_async_delay`|no|This sets the delay between retries for the role.|
43+
|`eda_configuration_users_secure_logging`|`aap_configuration_async_retries`|no|This variable sets the number of retries to attempt for the role.|
44+
|`aap_configuration_async_delay`|1|no|This sets the delay between retries for the role globally.|
45+
|`eda_configuration_users_async_retries`|`aap_configuration_async_delay`|no|This sets the delay between retries for the role.|
46+
|`aap_configuration_loop_delay`|1000|no|This variable sets the loop_delay for the role globally.|
47+
|`eda_configuration_users_async_delay`|`aap_configuration_loop_delay`|no|This variable sets the loop_delay for the role.|
48+
|`aap_configuration_async_dir`|`null`|no|Sets the directory to write the results file for async tasks. The default value is set to `null` which uses the Ansible Default of `/root/.ansible_async/`.|
4649

4750
## Data Structure
4851

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
eda_controller_tokens: []
33

4-
eda_configuration_user_token_secure_logging: "{{ aap_configuration_secure_logging | default(false) }}"
5-
eda_configuration_user_token_async_retries: "{{ aap_configuration_async_retries | default(50) }}"
6-
eda_configuration_user_token_async_delay: "{{ aap_configuration_async_delay| default(1) }}"
4+
eda_configuration_users_token_secure_logging: "{{ aap_configuration_secure_logging | default(false) }}"
5+
eda_configuration_users_token_async_retries: "{{ aap_configuration_async_retries | default(50) }}"
6+
eda_configuration_users_token_async_delay: "{{ aap_configuration_async_delay| default(1) }}"
77
aap_configuration_async_dir: null
88
...

roles/eda_controller_tokens/meta/argument_specs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ argument_specs:
1111
elements: dict
1212

1313
# Async variables
14-
eda_configuration_user_token_async_retries:
14+
eda_configuration_users_token_async_retries:
1515
default: "{{ aap_configuration_async_retries | default(50) }}"
1616
required: false
1717
description: This variable sets the number of retries to attempt for the role.
1818
aap_configuration_async_retries:
1919
default: 50
2020
required: false
2121
description: This variable sets number of retries across all roles as a default.
22-
eda_configuration_user_token_async_delay:
22+
eda_configuration_users_token_async_delay:
2323
default: "{{ aap_configuration_async_delay| default(1) }}"
2424
required: false
2525
description: This variable sets delay between retries for the role.
@@ -33,7 +33,7 @@ argument_specs:
3333
description: Sets the directory to write the results file for async tasks. The default value is set to `null` which uses the Ansible Default of `/root/.ansible_async/`.
3434

3535
# No_log variables
36-
eda_configuration_user_token_secure_logging:
36+
eda_configuration_users_token_secure_logging:
3737
default: "{{ aap_configuration_secure_logging | default(false) }}"
3838
required: false
3939
type: bool

roles/eda_controller_tokens/meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
galaxy_info:
3-
role_name: controller_token
3+
role_name: eda_controller_tokens
44
author: "Derek Waters"
55
description: "An Ansible Role to create a user token in EDA Controller."
66
company: "Red Hat"

roles/eda_controller_tokens/tasks/main.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,32 @@
1414
loop: "{{ eda_controller_tokens }}"
1515
loop_control:
1616
loop_var: "__token_item"
17-
no_log: "{{ eda_configuration_user_token_secure_logging }}"
17+
label: "{{ __operation.verb }} the Controller token {{ __token_item.name }} to EDA"
18+
pause: "{{ eda_configuration_users_token_async_delay }}"
19+
no_log: "{{ eda_configuration_users_token_secure_logging }}"
1820
async: 1000
1921
poll: 0
2022
register: __controller_tokens_job_async
2123
changed_when: not __controller_tokens_job_async.changed
2224
vars:
25+
__operation: "{{ operation_translate[__controller_tokens_job_async.state | default(platform_state) | default('present')] }}"
26+
2327
ansible_async_dir: '{{ aap_configuration_async_dir }}'
2428

2529
- name: "Create controller_token | Wait for finish the controller_token creation"
2630
ansible.builtin.async_status:
2731
jid: "{{ __controller_tokens_job_async_result_item.ansible_job_id }}"
2832
register: __controller_tokens_job_async_result
2933
until: __controller_tokens_job_async_result.finished
30-
retries: "{{ eda_configuration_user_token_async_retries }}"
31-
delay: "{{ eda_configuration_user_token_async_delay }}"
34+
retries: "{{ eda_configuration_users_token_async_retries }}"
35+
delay: "{{ eda_configuration_users_token_async_delay }}"
3236
loop: "{{ __controller_tokens_job_async.results }}"
3337
loop_control:
3438
loop_var: __controller_tokens_job_async_result_item
39+
label: "{{ __operation.verb }} Controller token {{ __controller_tokens_job_async_result_item.__token_item.name }} | Wait for finish the Controller token {{ __operation.action }}"
3540
when: __controller_tokens_job_async_result_item.ansible_job_id is defined
36-
no_log: "{{ eda_configuration_user_token_secure_logging }}"
41+
no_log: "{{ eda_configuration_users_token_secure_logging }}"
3742
vars:
43+
__operation: "{{ operation_translate[__controller_tokens_job_async_result_item.__controller_user_accounts_item.state | default(platform_state) | default('present')] }}"
3844
ansible_async_dir: '{{ aap_configuration_async_dir }}'
3945
...

0 commit comments

Comments
 (0)