2 Commits

Author SHA1 Message Date
0a8ac8bb58 feat(element): add ansible role 2024-09-19 18:04:57 +02:00
fdbf8f1e0d feat(cinny): add ansible role 2024-09-19 18:04:30 +02:00
16 changed files with 11 additions and 49 deletions

View File

@ -1,6 +0,0 @@
---
- name: Deploy and configure cinny
hosts: "{{ cinny_hosts | default('cinny') }}"
become: "{{ cinny_become | default(true) }}"
roles:
- role: finallycoffee.matrix.cinny

View File

@ -1,6 +0,0 @@
---
- name: Deploy and configure element
hosts: "{{ element_hosts | default('element') }}"
become: "{{ element_become | default(true) }}"
roles:
- role: finallycoffee.matrix.element

View File

@ -1,5 +1,4 @@
---
cinny_testvar: abc
cinny_config_complete: >-
{{ cinny_config | default({})
| combine(cinny_default_config | default({})) }}

View File

@ -16,11 +16,9 @@ cinny_container_restart_policy: >-
{{ (cinny_deployment_method == 'docker')
| ternary('unless-stopped',
(cinny_deployment_method == 'podman' |
ternary('on-failure', 'always')))
ternary('on-failure', 'always'))
}}
cinny_container_source: pull
cinny_container_user: "{{ cinny_host_uid }}"
cinny_container_full_volumes: >-
{{ cinny_container_default_volumes
+ cinny_container_volumes | default([]) }}

View File

@ -11,8 +11,8 @@ cinny_config_path: "{{ cinny_base_path }}/config"
cinny_config_file: "{{ cinny_config_path }}/config.json"
cinny_host_uid: >-
{{ (cinny_user_info is defined and 'uid' in cinny_user_info)
{{ cinny_user_info is defined
| ternary(cinny_user_info.uid, cinny_user) }}
cinny_host_gid: >-
{{ (cinny_user_info is defined and 'group' in cinny_user_info)
cinny_host_gid:
{{ cinny_user_info is defined
| ternary(cinny_user_info.group, cinny_user) }}

View File

@ -29,7 +29,7 @@
- name: Ensure config file is {{ cinny_state }}
ansible.builtin.copy:
content: "{{ cinny_config_complete | to_nice_json }}"
content: "{{ cinny_config | to_nice_json }}"
dest: "{{ cinny_config_file }}"
owner: "{{ cinny_host_uid }}"
group: "{{ cinny_host_gid }}"

View File

@ -14,7 +14,7 @@
community.docker.docker_image:
name: "{{ cinny_container_image }}"
state: "{{ cinny_state }}"
source: "{{ cinny_container_source | default('pull') }}"
source: "{{ cinny_container_source }}"
force_source: "{{ cinny_container_image_tag | default(false, true) }}"
- name: Ensure container '{{ cinny_container_name }}' is {{ cinny_state }}

View File

@ -8,13 +8,13 @@
ansible.builtin.slurp:
path: "{{ cinny_running_version_file }}"
register: cinny_running_version_info
when: cinny_running_version_st.stat.exists
when: cinny_running_version_st.stat.exist
- name: Extract running cinny version
set_fact:
cinny_is_update: >-
{{ not cinny_running_version_st.stat.exists or
(cinny_version is version(cinny_running_version, 'gt', version_type='semver')) }}
{{ not cinny_running_version_st.stat.exist or
(cinny_version | version(cinny_running_version, 'gt', version_type='semver'))
vars:
cinny_running_version: >-
{{ (cinny_running_version_info is defined)

View File

@ -6,10 +6,10 @@ Deploy the [element web-app](https://element.io/)
using the following supported methods by setting `element_deployment_method` to it:
- [`docker` (docs)](docs/docker.md) (default)
- `podman`
Planned deployment methods:
- `podman`
- `tarball`
- `nginx`
- `apache2`

View File

@ -13,6 +13,6 @@ element_config_file: "{{ element_config_path }}/config.json"
element_host_uid: >-
{{ element_user_info is defined
| ternary(element_user_info.uid, element_user) }}
element_host_gid: >-
element_host_gid:
{{ element_user_info is defined
| ternary(element_user_info.group, element_user) }}

View File

@ -1,22 +0,0 @@
---
- name: Ensure container image '{{ element_container_image }}' is {{ element_state }} locally
containers.podman.podman_image:
name: "{{ element_container_image }}"
state: "{{ element_state }}"
pull: "{{ element_container_source == 'pull' }}"
force: "{{ element_container_image_tag | default(false, true) }}"
- name: Ensure container '{{ element_container_name }}' is {{ element_state }}
containers.podman.podman_container:
name: "{{ element_container_name }}"
image: "{{ element_container_image }}"
state: "{{ (element_state == 'present') | ternary('started', 'absent') }}"
env: "{{ element_container_env | default(omit) }}"
user: "{{ element_container_user }}"
ports: "{{ element_container_ports | default(omit) }}"
labels: "{{ element_container_labels | default(omit) }}"
volumes: "{{ element_container_full_volumes }}"
network: "{{ element_container_networks | default(omit) }}"
hostname: "{{ element_container_hostname | default(omit) }}"
etc_hosts: "{{ element_container_etc_hosts | default(omit) }}"
restart_policy: "{{ element_container_restart_policy }}"

View File

@ -5,4 +5,3 @@ element_state:
element_deployment_methods:
- docker
- podman