diff --git a/roles/aws/aws_admin_tools/tasks/create_methods.yml b/roles/aws/aws_admin_tools/tasks/create_methods.yml index e06acf07a..7dfff713e 100644 --- a/roles/aws/aws_admin_tools/tasks/create_methods.yml +++ b/roles/aws/aws_admin_tools/tasks/create_methods.yml @@ -95,14 +95,18 @@ {{ '--credentials "arn:aws:iam::' + _acc_id + ':role/api_get_s3"' if item.resource == 's3' else '' }} when: item.url_params is not defined or item.url_params | length == 0 -- name: Generate template parts for each param - set_fact: - template_parts: "{{ item.url_params | map('regex_replace', '^(.*)$', '\\\"\\1\\\": \\\"$input.params(''\\1'')\\\"') | list }}" +- name: Generate URL parameters string + ansible.builtin.set_fact: + url_params_string: >- + {% for _url in item.url_params %} + {{ '' if loop.first else ',' }} + \"{{ _url }}\": \"$input.params('{{ _url }}')\" + {% endfor %} when: item.url_params is defined and item.url_params | length > 0 - name: Create final template string set_fact: - template_string: "{ \"application/json\": \"{ {{ template_parts | join(',') }} }\" }" + template_string: "{ \"application/json\": \"{ {{ url_params_string }} }\" }" when: item.url_params is defined and item.url_params | length > 0 - name: Write template to file diff --git a/roles/aws/aws_ec2_autoscale_cluster/tasks/main.yml b/roles/aws/aws_ec2_autoscale_cluster/tasks/main.yml index 9ea852e3c..3dcf5766b 100644 --- a/roles/aws/aws_ec2_autoscale_cluster/tasks/main.yml +++ b/roles/aws/aws_ec2_autoscale_cluster/tasks/main.yml @@ -784,4 +784,4 @@ aws_profile: "{{ aws_ec2_autoscale_cluster.aws_profile }}" source_region: "{{ aws_ec2_autoscale_cluster.region }}" region: "{{ aws_backup.copy_vault.region }}" - source_image_id: "{{ aws_ec2_autoscale_cluster_image_latest }}" + source_image_id: "{{ aws_ec2_autoscale_cluster_image_latest.image_id }}"