diff --git a/roles/element/README.md b/roles/element/README.md index 9cfadf0..c7d97a1 100644 --- a/roles/element/README.md +++ b/roles/element/README.md @@ -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` diff --git a/roles/element/tasks/deploy-podman.yml b/roles/element/tasks/deploy-podman.yml new file mode 100644 index 0000000..aa49b3f --- /dev/null +++ b/roles/element/tasks/deploy-podman.yml @@ -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 }}" diff --git a/roles/element/vars/main.yml b/roles/element/vars/main.yml index bcb8394..c8d3bc7 100644 --- a/roles/element/vars/main.yml +++ b/roles/element/vars/main.yml @@ -5,3 +5,4 @@ element_state: element_deployment_methods: - docker + - podman