Update wordpress to use service role
This commit is contained in:
44
roles/wordpress/molecule/default/verify.yml
Normal file
44
roles/wordpress/molecule/default/verify.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
# This is an example playbook to execute Ansible tests.
|
||||
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Ensure https://localhost responds appropriately
|
||||
ansible.builtin.uri:
|
||||
url: https://localhost
|
||||
validate_certs: false
|
||||
return_content: true
|
||||
register: get_localhost
|
||||
|
||||
- name: "Assert caddy responded on https://localhost"
|
||||
ansible.builtin.assert:
|
||||
that: "(get_localhost.server | split(', '))[0] == 'Caddy'"
|
||||
- name: "Assert apache responded on https://localhost"
|
||||
ansible.builtin.assert:
|
||||
that: "(get_localhost.server | split(', '))[1].startswith('Apache')"
|
||||
- name: Assert there was a redirect
|
||||
ansible.builtin.assert:
|
||||
that: "get_localhost.redirected == true"
|
||||
|
||||
- name: Get docker host info
|
||||
community.docker.docker_host_info:
|
||||
volumes: true
|
||||
register: docker_host_out
|
||||
- name: Assert all containers are running
|
||||
ansible.builtin.assert:
|
||||
that: docker_host_out.host_info.Containers == docker_host_out.host_info.ContainersRunning
|
||||
msg: There should have been {{ docker_host_out.host_info.Containers }} containers running but there were {{ docker_host_out.host_info.ContainersRunning }}
|
||||
- name: Assert correct number of containers were created
|
||||
ansible.builtin.assert:
|
||||
that: docker_host_out.host_info.Containers == 4
|
||||
msg: There should have been 4 containers created but there were {{ docker_host_out.host_info.Containers }}
|
||||
- name: Assert correct number of images were pulled
|
||||
ansible.builtin.assert:
|
||||
that: docker_host_out.host_info.Images == 6
|
||||
msg: There should have been 4 images present but there were {{ docker_host_out.host_info.Images }}
|
||||
- name: Assert no volumes were created
|
||||
ansible.builtin.assert:
|
||||
that: docker_host_out.volumes | length == 0
|
||||
msg: There should have been no volumes present but there were {{ docker_host_out.volumes | length }}
|
||||
Reference in New Issue
Block a user