Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix default values that contains a new line #23

Merged
merged 4 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- filetree_create job_template and workflow_job_template survey default values issue when they are multiline
...
1 change: 1 addition & 0 deletions roles/filetree_create/templates/current_job_templates.j2
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ controller_templates:
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs)[0])
| from_yaml | to_nice_yaml(indent=2,width=500,sort_keys=False) | regex_replace("\n\n[ ]*", "\\\\n")
| indent(width=6, first=False) | replace("'{{", "!unsafe \'{{") | replace("^$", "") | replace("$encrypted$", "")
| replace("'", '"') | regex_replace('default: ([^"].*)', 'default: "\\g<1>"')
-%}
{% if template_overrides_resources.job_template[current_job_templates_asset_value.name].survey_spec is defined
or template_overrides_global.job_template.survey_spec is defined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ controller_workflows:
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs)[0])
| from_yaml | to_nice_yaml(indent=2,width=500, sort_keys=False) | regex_replace("\n\n[ ]*", "\\\\n")
| indent(width=6, first=False) | replace("'{{", "!unsafe \'{{") | replace("^$", "") | replace("$encrypted$", "")
| replace("'", '"') | regex_replace('default: ([^"].*)', 'default: "\\g<1>"')
-%}
{% if template_overrides_resources.workflow_job_template[current_workflow_job_templates_asset_value.name].survey_spec is defined
or template_overrides_global.workflow_job_template.survey_spec is defined
Expand Down
1 change: 1 addition & 0 deletions roles/filetree_read/tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
collections
vars.yaml
30 changes: 15 additions & 15 deletions roles/filetree_read/tests/config-controller-filetree.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: Filetree read test
hosts: all
hosts: localhost
connection: local
gather_facts: false
vars:
controller_configuration_projects_async_retries: 120
controller_configuration_projects_async_delay: 2
controller_username: "{{ vault_controller_username | default(lookup('env', 'CONTROLLER_USERNAME')) }}"
controller_password: "{{ vault_controller_password | default(lookup('env', 'CONTROLLER_PASSWORD')) }}"
controller_hostname: "{{ vault_controller_hostname | default(lookup('env', 'CONTROLLER_HOST')) }}"
controller_validate_certs: "{{ vault_controller_validate_certs | default(lookup('env', 'CONTROLLER_VERIFY_SSL')) }}"
aap_configuration_projects_async_retries: 120
aap_configuration_projects_async_delay: 2
aap_username: "{{ vault_controller_username | default(lookup('env', 'CONTROLLER_USERNAME')) }}"
aap_password: "{{ vault_controller_password | default(lookup('env', 'CONTROLLER_PASSWORD')) }}"
aap_hostname: "{{ vault_controller_hostname | default(lookup('env', 'CONTROLLER_HOST')) }}"
aap_validate_certs: "{{ vault_controller_validate_certs | default(lookup('env', 'CONTROLLER_VERIFY_SSL')) }}"
pre_tasks:
- name: "Setup authentication (block)"
no_log: "{{ controller_configuration_filetree_read_secure_logging | default('false') }}"
Expand All @@ -19,12 +19,12 @@
block:
- name: "Get the Authentication Token for the future requests"
ansible.builtin.uri:
url: "https://{{ controller_hostname }}/api/v2/tokens/"
user: "{{ controller_username }}"
password: "{{ controller_password }}"
url: "https://{{ aap_hostname }}/api/v2/tokens/"
user: "{{ aap_username }}"
password: "{{ aap_password }}"
method: POST
force_basic_auth: true
validate_certs: "{{ controller_validate_certs }}"
validate_certs: "{{ aap_validate_certs }}"
status_code: 201
register: authtoken_res

Expand All @@ -39,12 +39,12 @@
post_tasks:
- name: "Delete the Authentication Token used"
ansible.builtin.uri:
url: "https://{{ controller_hostname }}{{ controller_oauthtoken_url }}"
user: "{{ controller_username }}"
password: "{{ controller_password }}"
url: "https://{{ aap_hostname }}{{ controller_oauthtoken_url }}"
user: "{{ aap_username }}"
password: "{{ aap_password }}"
method: DELETE
force_basic_auth: true
validate_certs: "{{ controller_validate_certs }}"
validate_certs: "{{ aap_validate_certs }}"
status_code: 204
when: controller_oauthtoken_url is defined
...