Fix integration tests to support remote hosts.

This commit is contained in:
Matt Clay
2019-01-24 19:25:06 -08:00
parent 92b475f721
commit d2a7cc0b9f
37 changed files with 321 additions and 225 deletions

View File

@@ -16,15 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
- name: get the jinja2 version
shell: python -c 'import jinja2; print(jinja2.__version__)'
register: jinja2_version
delegate_to: localhost
changed_when: no
- debug:
msg: "Jinja version: {{ jinja2_version.stdout }}, Python version: {{ ansible_facts.python_version }}"
## user add
@@ -183,14 +174,7 @@
- user_test1.results is defined
- user_test1.results | length == 5
- name: validate changed results for testcase 1 (jinja >= 2.6)
assert:
that:
- user_test1.results | map(attribute='changed') | unique | list == [False]
- user_test1.results | map(attribute='state') | unique | list == ['present']
when: jinja2_version.stdout is version('2.6', '>=')
- name: validate changed results for testcase 1 (jinja < 2.6)
- name: validate changed results for testcase 1
assert:
that:
- "user_test1.results[0] is not changed"
@@ -203,7 +187,6 @@
- "user_test1.results[2]['state'] == 'present'"
- "user_test1.results[3]['state'] == 'present'"
- "user_test1.results[4]['state'] == 'present'"
when: jinja2_version.stdout is version('2.6', '<')
## user remove