forked from davestephens/ansible-nas
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
560 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -793,6 +793,10 @@ | |
tags: | ||
- restic | ||
|
||
- role: richy | ||
tags: | ||
- richy | ||
|
||
- role: romm | ||
tags: | ||
- romm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
richy_enabled: false | ||
richy_available_externally: false | ||
|
||
# directories | ||
richy_data_directory: "{{ docker_home }}/richy" | ||
|
||
# network | ||
richy_port: "8176" | ||
richy_hostname: "richy" | ||
richy_network_name: "richy" | ||
|
||
# specs | ||
richy_memory: 1g | ||
richy_db_memory: 1g | ||
richy_nginx_memory: 1g | ||
richy_redis_memory: 1g | ||
richy_worker_memory: 1g | ||
richy_worker_slow_memory: 1g | ||
richy_worker_fast_memory: 1g | ||
richy_beat_memory: 1g | ||
|
||
# docker | ||
richy_container_name: richy | ||
richy_image_name: "n1cz/richy" | ||
richy_image_version: latest | ||
richy_db_container_name: richy-db | ||
richy_db_image_name: "postgres" | ||
richy_db_image_version: 16-alpine | ||
richy_nginx_container_name: richy-nginx | ||
richy_nginx_image_name: "nginx" | ||
richy_nginx_image_version: 1.23-alpine | ||
richy_redis_container_name: richy-redis | ||
richy_redis_image_name: redis | ||
richy_redis_image_version: 7-alpine | ||
richy_worker_container_name: richy-worker | ||
richy_worker_image_name: "n1cz/richy" | ||
richy_worker_image_version: latest | ||
richy_worker_slow_container_name: richy-worker-slow | ||
richy_worker_slow_image_name: "n1cz/richy" | ||
richy_worker_slow_image_version: latest | ||
richy_worker_fast_container_name: richy-worker-fast | ||
richy_worker_fast_image_name: "n1cz/richy" | ||
richy_worker_fast_image_version: latest | ||
richy_beat_container_name: richy-beat | ||
richy_beat_image_name: "n1cz/richy" | ||
richy_beat_image_version: latest | ||
richy_user_id: "1000" | ||
richy_group_id: "1000" | ||
|
||
# richy | ||
richy_db_user: richy | ||
richy_db_name: richy | ||
richy_db_pass: tralala256 | ||
richy_sentry_url: "" | ||
richy_sentry_enable: "false" | ||
richy_base_url: "https://{{ richy_hostname }}.{{ ansible_nas_domain }}" | ||
richy_domain: "{{ richy_hostname }}.{{ ansible_nas_domain }}" | ||
richy_redis_url: "{{ richy_redis_container_name }}:6379" | ||
|
||
# main env dictionary for the container and for merging with optional environment variables | ||
richy_env: | ||
DB_PASSWORD: "{{ richy_db_pass }}" | ||
DB_HOST: "{{ richy_db_container_name }}" | ||
DB_NAME: "{{ richy_db_name }}" | ||
DB_USER: "{{ richy_db_user }}" | ||
SENTRY_URL: "{{ richy_sentry_url }}" | ||
SENTRY_ENABLE: "{{ richy_sentry_enable }}" | ||
TZ: "{{ ansible_nas_timezone }}" | ||
BASE_URL: "{{ richy_base_url }}" | ||
DOMAIN: "{{ richy_domain }}" | ||
REDIS_URL: "{{ richy_redis_url }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
richy_enabled: true | ||
richy_data_directory: "/tmp/richy" | ||
platforms: | ||
- name: instance | ||
image: geerlingguy/docker-ubuntu2204-ansible:latest | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- /tmp:/tmp:rw | ||
privileged: true | ||
pre_build_image: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Stop | ||
hosts: all | ||
become: true | ||
tasks: | ||
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role" | ||
ansible.builtin.include_role: | ||
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" | ||
vars: | ||
richy_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Include vars | ||
ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Get richy db container state | ||
community.docker.docker_container: | ||
name: "{{ richy_db_container_name }}" | ||
register: result_db | ||
|
||
- name: Get richy redis container state | ||
community.docker.docker_container: | ||
name: "{{ richy_redis_container_name }}" | ||
register: result_redis | ||
|
||
- name: Get richy nginx container state | ||
community.docker.docker_container: | ||
name: "{{ richy_nginx_container_name }}" | ||
register: result_nginx | ||
|
||
- name: Get richy worker container state | ||
community.docker.docker_container: | ||
name: "{{ richy_worker_container_name }}" | ||
register: result_worker | ||
|
||
- name: Get richy worker slow container state | ||
community.docker.docker_container: | ||
name: "{{ richy_worker_slow_container_name }}" | ||
register: result_worker_slow | ||
|
||
- name: Get richy worker fast container state | ||
community.docker.docker_container: | ||
name: "{{ richy_worker_fast_container_name }}" | ||
register: result_worker_fast | ||
|
||
- name: Get richy beat container state | ||
community.docker.docker_container: | ||
name: "{{ richy_beat_container_name }}" | ||
register: result_beat | ||
|
||
- name: Get richy container state | ||
community.docker.docker_container: | ||
name: "{{ richy_container_name }}" | ||
register: result | ||
|
||
- name: Check if richy containers are running | ||
ansible.builtin.assert: | ||
that: | ||
- result_db.container['State']['Status'] == "running" | ||
- result_db.container['State']['Restarting'] == false | ||
- result_redis.container['State']['Status'] == "running" | ||
- result_redis.container['State']['Restarting'] == false | ||
- result_nginx.container['State']['Status'] == "running" | ||
- result_nginx.container['State']['Restarting'] == false | ||
- result_worker.container['State']['Status'] == "running" | ||
- result_worker.container['State']['Restarting'] == false | ||
- result_worker_slow.container['State']['Status'] == "running" | ||
- result_worker_slow.container['State']['Restarting'] == false | ||
- result_worker_fast.container['State']['Status'] == "running" | ||
- result_worker_fast.container['State']['Restarting'] == false | ||
- result_beat.container['State']['Status'] == "running" | ||
- result_beat.container['State']['Restarting'] == false | ||
- result.container['State']['Status'] == "running" | ||
- result.container['State']['Restarting'] == false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Include vars | ||
ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Try and stop and remove richy | ||
community.docker.docker_container: | ||
name: "{{ richy_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Try and stop and remove richy db | ||
community.docker.docker_container: | ||
name: "{{ richy_db_container_name }}" | ||
state: absent | ||
register: result_db | ||
|
||
- name: Try and stop and remove richy redis | ||
community.docker.docker_container: | ||
name: "{{ richy_redis_container_name }}" | ||
state: absent | ||
register: result_redis | ||
|
||
- name: Try and stop and remove richy nginx | ||
community.docker.docker_container: | ||
name: "{{ richy_nginx_container_name }}" | ||
state: absent | ||
register: result_nginx | ||
|
||
- name: Try and stop and remove richy worker | ||
community.docker.docker_container: | ||
name: "{{ richy_worker_container_name }}" | ||
state: absent | ||
register: result_worker | ||
|
||
- name: Try and stop and remove richy worker slow | ||
community.docker.docker_container: | ||
name: "{{ richy_worker_slow_container_name }}" | ||
state: absent | ||
register: result_worker_slow | ||
|
||
- name: Try and stop and remove richy worker fast | ||
community.docker.docker_container: | ||
name: "{{ richy_worker_fast_container_name }}" | ||
state: absent | ||
register: result_worker_fast | ||
|
||
- name: Try and stop and remove richy beat | ||
community.docker.docker_container: | ||
name: "{{ richy_beat_container_name }}" | ||
state: absent | ||
register: result_beat | ||
|
||
- name: Check if richy is stopped | ||
ansible.builtin.assert: | ||
that: | ||
- not result.changed | ||
- not result_db.changed | ||
- not result_redis.changed | ||
- not result_nginx.changed | ||
- not result_worker.changed | ||
- not result_worker_slow.changed | ||
- not result_worker_fast.changed | ||
- not result_beat.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../requirements.yml |
Oops, something went wrong.