From dba0ad5027af1718269785deecbdfcd0917bcdcb Mon Sep 17 00:00:00 2001 From: spmfox Date: Fri, 30 Aug 2024 11:01:42 -0400 Subject: removed default variables from containers role, updated sample environment and readme to match --- README.md | 11 +++++------ docs/sample-environment/wordpress/wordpress.yml | 13 +++++++++++++ roles/containers/defaults/main.yml | 11 ----------- 3 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 docs/sample-environment/wordpress/wordpress.yml delete mode 100644 roles/containers/defaults/main.yml diff --git a/README.md b/README.md index 6e1e16d..9d71dcc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Quadlet files and some understanding of quadlet and/or systemd is required to us ## Usage ansible-playbook host.yml sudo machinectl shell containers@ - ansible-playbook containers.yml + ansible-playbook -i docs/sample-environment/wordpress/wordpress.yml containers.yml ## Features - Designed for rootless Podman @@ -18,18 +18,17 @@ Quadlet files and some understanding of quadlet and/or systemd is required to us - Define your application's quadlet files so they are treated as one entity with Ansible ## Sample Environment -A fully working pod with Wordpress and a MariaDB database are in the `docs/sample-environment` directory. -The default variables in the `container` role will use this sample environment for deployment. -Provide your own inventory and/or variables to override this. +A fully working pod with Wordpress and a MariaDB database are in the `docs/sample-environment/wordpress` directory. +The environment variables are in `wordpress.yml`, you'll also find the containerfiles and the quadlet files. ## Requirements - Ansible -- Ansible collections: - - ```ansible-galaxy install -r collections/requirements.yml``` - Podman - User with `sudo` rights (to create unprivileged user) ## Operation +- **Note:** `host.yml` and `containers.yml` will default to execute on localhost if a host isn't provided + - This means you can either create a full inventory with a host and variables or just variables that will be run against localhost - `host.yml` - installs the needed packages and creates the `containers` unprivileged user - use with a privileged account - `containers.yml` - will copy the quadlet files and start the quadlet - use with the unprivileged account diff --git a/docs/sample-environment/wordpress/wordpress.yml b/docs/sample-environment/wordpress/wordpress.yml new file mode 100644 index 0000000..c4cd72b --- /dev/null +++ b/docs/sample-environment/wordpress/wordpress.yml @@ -0,0 +1,13 @@ +all: + vars: + containers_quadlet_path: "docs/sample-environment/wordpress/quadlet" + + containers_quadlets: + - name: "wordpress-pod" + file: "wordpress.pod" + + - name: "wordpress-app" + file: "wordpress-app.container" + + - name: "wordpress-db" + file: "wordpress-db.container" diff --git a/roles/containers/defaults/main.yml b/roles/containers/defaults/main.yml deleted file mode 100644 index 2a55101..0000000 --- a/roles/containers/defaults/main.yml +++ /dev/null @@ -1,11 +0,0 @@ -containers_quadlet_path: "../../docs/sample-environment/wordpress/quadlet" - -containers_quadlets: - - name: "wordpress-pod" - file: "wordpress.pod" - - - name: "wordpress-app" - file: "wordpress-app.container" - - - name: "wordpress-db" - file: "wordpress-db.container" -- cgit