Skip to content

Commit

Permalink
Skip some test in vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Apr 12, 2022
1 parent bb9bb2a commit 82ab756
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions tests/tasks/post.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
# post test file
---
- name: test presence of private key
shell: >
diff {{ ssh_keys_private_keys[0]['src'] }} ~dummy/.ssh/{{ ssh_keys_private_keys[0]['src'] | basename }}
&& (echo 'Private key test: pass' && exit 0)
|| (echo 'Private key test: fail' && exit 1)
args:
warn: false
- name: set fact
command: >
echo "{{ ansible_connection }}"
register: _ansible_connection
changed_when: false
tags:
- skip_ansible_lint

- name: test presence of public key
shell: >
diff {{ ssh_keys_public_keys[0]['src'] }} ~dummy/.ssh/{{ ssh_keys_public_keys[0]['src'] | basename }}
&& (echo 'Public key test: pass' && exit 0)
|| (echo 'Public key test: fail' && exit 1)
args:
warn: false
changed_when: false
- block:

- name: test presence of private key
shell: >
diff {{ ssh_keys_private_keys[0]['src'] }} ~dummy/.ssh/{{ ssh_keys_private_keys[0]['src'] | basename }}
&& (echo 'Private key test: pass' && exit 0)
|| (echo 'Private key test: fail' && exit 1)
args:
warn: false
changed_when: false
tags:
- skip_ansible_lint

- name: test presence of public key
shell: >
diff {{ ssh_keys_public_keys[0]['src'] }} ~dummy/.ssh/{{ ssh_keys_public_keys[0]['src'] | basename }}
&& (echo 'Public key test: pass' && exit 0)
|| (echo 'Public key test: fail' && exit 1)
args:
warn: false
changed_when: false

when: _ansible_connection.stdout != 'ssh'
tags:
- skip_ansible_lint

Expand Down

0 comments on commit 82ab756

Please sign in to comment.