1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

used stdoutlines list to avoid string mismatches

added block environment test
This commit is contained in:
Brian Coca 2015-08-25 00:40:57 -04:00
parent 079a1c843d
commit 3e13dfd7e8

View file

@ -12,7 +12,7 @@
- name: assert no val in stdout
assert:
that:
- '"val1" not in test_env.stdout'
- '"val1" not in test_env.stdout_lines'
- name: check that envvar does exist
shell: echo $key1
@ -22,7 +22,7 @@
- name: assert val1 in stdout
assert:
that:
- '"val1" in test_env2.stdout'
- '"val1" in test_env2.stdout_lines'
- hosts: testhost
tasks:
@ -41,7 +41,7 @@
- name: assert val1 in stdout
assert:
that:
- '"val1" in test_env3.stdout'
- '"val1" in test_env3.stdout_lines'
- name: check that task envvar does exist
shell: echo $key1; echo $other1
@ -51,6 +51,19 @@
- name: assert all vars appear as expected
assert:
that:
- '"val1" not in test_env4.stdout'
- '"not1" in test_env4.stdout'
- '"val2" in test_env4.stdout'
- '"val1" not in test_env4.stdout_lines'
- '"not1" in test_env4.stdout_lines'
- '"val2" in test_env4.stdout_lines'
- block:
- name: check that task envvar does exist in block
shell: echo $key1; echo $other1
register: test_env5
- name: assert all vars appear as expected in block
assert:
that:
- '"val1" not in test_env5.stdout_lines'
- '"not1" in test_env5.stdout_lines'
- '"val2" in test_env5.stdout_lines'
environment: "{{test2}}"