Initial Commit - Semaphore testing after podman-host

This commit is contained in:
Mike Holloway committed 2025-11-28 22:40:46 -05:00
commit fbc6af6134
8 files changed
+204

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
# step ca certificate "ca.equilibrateit.test" ca.equilibrateit.test.crt ca.equilibrateit.test.key
# chown 100999:100999 ~stepca/nginx/certs/ca.equilibrateit.test.*
# manual standup passes test
# curl --connect-to ca.equilibrateit.test:4443:localhost:4443 https://ca.equilibrateit.test:4443/health
+53
View File
@@ -0,0 +1,53 @@
- name: Container tasks
block:
- name: Pod State created
containers.podman.podman_pod:
name: "pod_nextcloud"
state: created
share: ipc,uts
hostname: "{{ ansible_host }}"
restart_policy: always
- name: nextcloud Container State created
containers.podman.podman_container:
name: "nextcloud_app_1"
state: created
pod: "pod_nextcloud"
image: "docker.io/nextcloud/nextcloud:stable-fpm"
network: bridge
ports:
- 9000:9000
volumes:
- "/home/{{ user.name }}/nextcloud/data:/home/step"
env:
VIRTUAL_HOST_MULTIPORTS: "{{ lookup('ansible.builtin.template','nextcloud_multiports.json.j2')}}"
VIRTUAL_PROTO: "https"
- name: NGINX Proxy Container State created
containers.podman.podman_container:
name: "nextcloud_nginx-proxy_1"
state: created
pod: "pod_nextcloud"
image: "docker.io/nginxproxy/nginx-proxy:latest"
network: bridge
ports:
- 8080:80
- 4443:443
volumes:
- "/home/{{ user.name }}/nginx/html:/usr/share/nginx/html"
- "/home/{{ user.name }}/nginx/nextcloud_internal_vhost:/etc/nginx/vhost.d/{{ ansible_host }}_location"
- "/home/{{ user.name }}/nginx/certs:/etc/nginx/certs"
- "/run/user/{{ getent_passwd[user.name][2] }}/podman/podman.sock:/tmp/docker.sock:ro"
- name: Container State started
containers.podman.podman_container:
name: "{{ container_to_start }}"
state: started
pod: "pod_nextcloud"
with_items:
- "nextcloud_app_1"
- "nextcloud_nginx-proxy_1"
tags:
- init
loop_control:
loop_var: "container_to_start"
+21
View File
@@ -0,0 +1,21 @@
- name: Container Path data State directory
file:
path: "/home/{{ user.name }}/nextcloud/data"
state: directory
owner: "100999"
group: "100999"
- name: Container Path certs State directory
file:
path: "/home/{{ user.name }}/nginx/certs"
state: directory
owner: "100999"
group: "100999"
- name: Container Path html State directory
file:
path: "/home/{{ user.name }}/nginx/html"
state: directory
owner: "100999"
group: "100999"
+23
View File
@@ -0,0 +1,23 @@
- name: Root port forwards for web traffic.
firewalld:
rich_rule: "{{ item }}"
zone: public
permanent: true
immediate: true
state: enabled
with_items:
- "rule family=ipv4 forward-port port=80 protocol=tcp to-port=8080"
- "rule family=ipv4 forward-port port=443 protocol=tcp to-port=4443"
firewalld:
rich_rule: "{{ item }}"
zone: trusted
permanent: true
immediate: true
state: enabled
with_items:
- "rule family=ipv4 forward-port port=80 protocol=tcp to-port=8080"
- "rule family=ipv4 forward-port port=443 protocol=tcp to-port=4443"
- command:
cmd: "firewall-cmd --reload"
+8
View File
@@ -0,0 +1,8 @@
---
- name: Load a variable file based on the OS type, or a default if not found.
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "default.yml"
+25
View File
@@ -0,0 +1,25 @@
---
# tasks file for podman_nextcloud
- import_tasks: include-vars.yml
#- import_tasks: packages.yml
- import_tasks: firewall.yml
when: '"molecule" not in group_names'
- name: Parse passwd
getent:
database: passwd
- block:
- include_tasks: files.yml
with_items:
- "{{ service_users }}"
loop_control:
loop_var: "user"
- include_tasks: containers.yml
with_items:
- "{{ service_users }}"
loop_control:
loop_var: "user"
when: '"nextcloud" in user.services'
+18
View File
@@ -0,0 +1,18 @@
- name: RPM fetch
get_url:
url: https://github.com/smallstep/cli/releases/download/v0.28.2/step-cli_amd64.rpm
checksum: sha256:https://github.com/smallstep/cli/releases/download/v0.28.2/checksums.txt
dest: /tmp/
register: client_rpm
- name: RPM State present
dnf:
name: "{{ client_rpm.dest }}"
state: present
disable_gpg_check: True
when: '"OK" in client_rpm.msg'
- name: Required Host Packages State latest
dnf:
name: openssl
state: latest