mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-26 10:15:14 +00:00
Bitwarden tests and tasks fix
This commit is contained in:
parent
81da82de8f
commit
1759c79b67
5 changed files with 67 additions and 1 deletions
6
roles/bitwarden/molecule/default/molecule.yml
Normal file
6
roles/bitwarden/molecule/default/molecule.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
provisioner:
|
||||
inventory:
|
||||
group_vars:
|
||||
all:
|
||||
bitwarden_enabled: true
|
10
roles/bitwarden/molecule/default/side_effect.yml
Normal file
10
roles/bitwarden/molecule/default/side_effect.yml
Normal 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:
|
||||
bitwarden_enabled: false
|
25
roles/bitwarden/molecule/default/verify.yml
Normal file
25
roles/bitwarden/molecule/default/verify.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- include_vars:
|
||||
file: ../../defaults/main.yml
|
||||
|
||||
- name: Get container state
|
||||
docker_container_info:
|
||||
name: "{{ bitwarden_container_name }}"
|
||||
register: result
|
||||
|
||||
- name: Get container state
|
||||
docker_container_info:
|
||||
name: "{{ bitwarden_backup_container_name }}"
|
||||
register: result_backup
|
||||
|
||||
- name: Check Bitwarden is running
|
||||
assert:
|
||||
that:
|
||||
- result.container['State']['Status'] == "running"
|
||||
- result.container['State']['Restarting'] == false
|
||||
- result_backup.container['State']['Status'] == "running"
|
||||
- result_backup.container['State']['Restarting'] == false
|
25
roles/bitwarden/molecule/default/verify_stopped.yml
Normal file
25
roles/bitwarden/molecule/default/verify_stopped.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- include_vars:
|
||||
file: ../../defaults/main.yml
|
||||
|
||||
- name: Try and stop and remove Bitwarden
|
||||
docker_container:
|
||||
name: "{{ bitwarden_container_name }}"
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- name: Try and stop and remove Bitwarden Backup
|
||||
docker_container:
|
||||
name: "{{ bitwarden_backup_container_name }}"
|
||||
state: absent
|
||||
register: result_backup
|
||||
|
||||
- name: Check Bitwarden is stopped
|
||||
assert:
|
||||
that:
|
||||
- not result.changed
|
||||
- not result_backup.changed
|
|
@ -20,7 +20,7 @@
|
|||
volumes:
|
||||
- "{{ bitwarden_data_directory }}:/data:rw"
|
||||
env:
|
||||
SIGNUPS_ALLOWED: "{{ bitwarden_allow_signups }}"
|
||||
SIGNUPS_ALLOWED: "{{ bitwarden_allow_signups | string }}"
|
||||
ADMIN_TOKEN: "{{ bitwarden_admin_token }}"
|
||||
LOG_FILE: "/data/bitwarden.log"
|
||||
WEBSOCKET_ENABLED: "true"
|
||||
|
|
Loading…
Reference in a new issue