Compare commits
3 Commits
0a8ac8bb58
...
dev
Author | SHA1 | Date | |
---|---|---|---|
c29c7ded3f
|
|||
e35f040229
|
|||
dedbb72b70
|
6
playbooks/cinny.yml
Normal file
6
playbooks/cinny.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Deploy and configure cinny
|
||||
hosts: "{{ cinny_hosts | default('cinny') }}"
|
||||
become: "{{ cinny_become | default(true) }}"
|
||||
roles:
|
||||
- role: finallycoffee.matrix.cinny
|
6
playbooks/element.yml
Normal file
6
playbooks/element.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Deploy and configure element
|
||||
hosts: "{{ element_hosts | default('element') }}"
|
||||
become: "{{ element_become | default(true) }}"
|
||||
roles:
|
||||
- role: finallycoffee.matrix.element
|
@ -1,4 +1,5 @@
|
||||
---
|
||||
cinny_testvar: abc
|
||||
cinny_config_complete: >-
|
||||
{{ cinny_config | default({})
|
||||
| combine(cinny_default_config | default({})) }}
|
@ -16,9 +16,11 @@ 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([]) }}
|
@ -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
|
||||
{{ (cinny_user_info is defined and 'uid' in cinny_user_info)
|
||||
| ternary(cinny_user_info.uid, cinny_user) }}
|
||||
cinny_host_gid:
|
||||
{{ cinny_user_info is defined
|
||||
cinny_host_gid: >-
|
||||
{{ (cinny_user_info is defined and 'group' in cinny_user_info)
|
||||
| ternary(cinny_user_info.group, cinny_user) }}
|
@ -29,7 +29,7 @@
|
||||
|
||||
- name: Ensure config file is {{ cinny_state }}
|
||||
ansible.builtin.copy:
|
||||
content: "{{ cinny_config | to_nice_json }}"
|
||||
content: "{{ cinny_config_complete | to_nice_json }}"
|
||||
dest: "{{ cinny_config_file }}"
|
||||
owner: "{{ cinny_host_uid }}"
|
||||
group: "{{ cinny_host_gid }}"
|
||||
|
@ -14,7 +14,7 @@
|
||||
community.docker.docker_image:
|
||||
name: "{{ cinny_container_image }}"
|
||||
state: "{{ cinny_state }}"
|
||||
source: "{{ cinny_container_source }}"
|
||||
source: "{{ cinny_container_source | default('pull') }}"
|
||||
force_source: "{{ cinny_container_image_tag | default(false, true) }}"
|
||||
|
||||
- name: Ensure container '{{ cinny_container_name }}' is {{ cinny_state }}
|
||||
|
@ -8,13 +8,13 @@
|
||||
ansible.builtin.slurp:
|
||||
path: "{{ cinny_running_version_file }}"
|
||||
register: cinny_running_version_info
|
||||
when: cinny_running_version_st.stat.exist
|
||||
when: cinny_running_version_st.stat.exists
|
||||
|
||||
- name: Extract running cinny version
|
||||
set_fact:
|
||||
cinny_is_update: >-
|
||||
{{ not cinny_running_version_st.stat.exist or
|
||||
(cinny_version | version(cinny_running_version, 'gt', version_type='semver'))
|
||||
{{ not cinny_running_version_st.stat.exists or
|
||||
(cinny_version is version(cinny_running_version, 'gt', version_type='semver')) }}
|
||||
vars:
|
||||
cinny_running_version: >-
|
||||
{{ (cinny_running_version_info is defined)
|
||||
|
@ -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`
|
||||
|
@ -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) }}
|
22
roles/element/tasks/deploy-podman.yml
Normal file
22
roles/element/tasks/deploy-podman.yml
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
- 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 }}"
|
@ -5,3 +5,4 @@ element_state:
|
||||
|
||||
element_deployment_methods:
|
||||
- docker
|
||||
- podman
|
||||
|
Reference in New Issue
Block a user