Calibre testing

This commit is contained in:
David Stephens 2022-09-11 18:46:55 +01:00
parent 03454fd592
commit 4581e480c1
4 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
calibre_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
calibre_enabled: false

View file

@ -0,0 +1,18 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
name: "{{ calibre_container_name }}"
register: result
- name: Check Calibre is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,18 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Calibre
docker_container:
name: "{{ calibre_container_name }}"
state: absent
register: result
- name: Check Calibre is stopped
assert:
that:
- not result.changed