major cleanup of ansible tasks in podman role

This commit is contained in:
Bastian de Byl
2023-07-24 13:38:34 -04:00
parent 71e9f4590b
commit 4c40a42707
18 changed files with 227 additions and 249 deletions

View File

@@ -13,7 +13,6 @@
- "{{ cloud_path }}/config"
- "{{ cloud_path }}/data"
- "{{ cloud_path }}/mysql"
tags: cloud
- name: unshare chown the nextcloud volumes
become: true
@@ -21,14 +20,12 @@
changed_when: false
ansible.builtin.command: |
podman unshare chown -R 33:33 {{ cloud_path }}/data {{ cloud_path}}/config
tags: cloud
- name: get user/group id from unshare
become: true
ansible.builtin.stat:
path: "{{ cloud_path }}/data"
register: cloud_owner
tags: cloud
- name: mount cloud cifs
become: true
@@ -38,20 +35,21 @@
fstype: cifs
opts: "username=cloud,password={{ cloud_cifs_pass }},uid={{ cloud_owner.stat.uid }},gid={{ cloud_owner.stat.uid }}"
state: mounted
tags: cloud
- name: flush handlers
ansible.builtin.meta: flush_handlers
tags: cloud
- import_tasks: podman/podman-check.yml
vars:
container_name: cloud-db
container_image: "{{ db_image }}"
- name: create cloud-db container
become: true
become_user: "{{ podman_user }}"
containers.podman.podman_container:
name: cloud-db
image: docker.io/mariadb:10.5
recreate: false
restart: false
image: "{{ db_image }}"
restart_policy: on-failure:3
log_driver: journald
network:
@@ -63,22 +61,23 @@
MYSQL_USER: cloud
volumes:
- "{{ cloud_path }}/mysql:/var/lib/mysql"
tags: cloud
- name: create systemd startup job for cloud-db
include_tasks: systemd-generate.yml
include_tasks: podman/systemd-generate.yml
vars:
container_name: cloud-db
tags: cloud
- import_tasks: podman/podman-check.yml
vars:
container_name: cloud
container_image: "{{ image }}"
- name: create cloud container
become: true
become_user: "{{ podman_user }}"
containers.podman.podman_container:
name: cloud
image: docker.io/nextcloud:24.0.5-apache
recreate: false
restart: false
image: "{{ image }}"
restart_policy: on-failure:3
log_driver: journald
network:
@@ -94,10 +93,8 @@
- "{{ cloud_path }}/config:/var/www/html/config"
ports:
- "8089:80"
tags: cloud
- name: create systemd startup job for cloud
include_tasks: systemd-generate.yml
include_tasks: podman/systemd-generate.yml
vars:
container_name: cloud
tags: cloud