diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index fcb5495..3f1ea7a 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -3,12 +3,5 @@ hosts: all become: true tasks: - - name: test r installation - ansible.builtin.shell: > - Rscript -e 'print(gsub("I","O","PING"))' - | grep -q 'PONG' - && (echo 'Availability test: pass' && exit 0) - || (echo 'Availability test: fail' && exit 1) - changed_when: false - tags: - - skip_ansible_lint + - name: include tasks + ansible.builtin.import_tasks: "{{ playbook_dir }}/../../tests/tasks/post.yml" diff --git a/tests/tasks/post.yml b/tests/tasks/post.yml new file mode 100644 index 0000000..678f8bb --- /dev/null +++ b/tests/tasks/post.yml @@ -0,0 +1,11 @@ +# post test file +--- +- name: test r installation + ansible.builtin.shell: > + Rscript -e 'print(gsub("I","O","PING"))' + | grep -q 'PONG' + && (echo 'Availability test: pass' && exit 0) + || (echo 'Availability test: fail' && exit 1) + changed_when: false + tags: + - skip_ansible_lint diff --git a/tests/test.yml b/tests/test.yml index a3d75ca..5969110 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -5,6 +5,9 @@ become: true roles: - ../../ + post_tasks: + - name: include tasks + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/post.yml" vars: r_packages: - name: DBI diff --git a/tests/vagrant.yml b/tests/vagrant.yml index afdaebc..cb458a1 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -5,3 +5,6 @@ become: true roles: - ../../ + post_tasks: + - name: include tasks + ansible.builtin.import_tasks: "{{ playbook_dir }}/tasks/post.yml"