Skip to content

Commit

Permalink
aws_s3: simplify the template check (#740)
Browse files Browse the repository at this point in the history
aws_s3: simplify the template check

Don't compare strings with \n character. This triggers errors like this:
fatal: [testhost]: FAILED! => {
    "msg": "The conditional check 'result.contents == \"template:\ntest template\n\"' failed. The error was: Invalid conditional detected: EOL while scanning string literal (<unknown>, line 1)"
}

Reviewed-by: Alina Buzachis <None>
(cherry picked from commit d3e81b7)
  • Loading branch information
goneri authored and patchback[bot] committed Mar 28, 2022
1 parent 2e8ab93 commit 7b641ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/integration/targets/aws_s3/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
bucket: "{{ bucket_name }}"
object: put-template.txt
mode: put
content: "{{ lookup('template', 'templates/put-template.txt.j2') }}"
content: "{{ lookup('template', 'templates/put-template.txt.j2')|replace('\n', '') }}"
register: result

- assert:
Expand All @@ -682,7 +682,7 @@

- assert:
that:
- result.contents == "{{ lookup('template', 'templates/put-template.txt.j2') }}"
- result.contents == "template:test template"

# at present, there is no lookup that can process binary data, so we use slurp instead
- slurp:
Expand Down

0 comments on commit 7b641ea

Please sign in to comment.