iac_stack/ansible/roles/deploy_container_homepage/README.md
2025-07-15 00:11:39 +02:00

3.4 KiB
Raw Blame History

Hier ist ein passendes README.md, das deine Anforderungen erfüllt:


📦 Ansible Role: Container Homepage

This role deploys a tenant-specific instance of the homepage container (e.g. gethomepage.dev) It uses Docker Compose and copies custom configuration files per host.


🚀 Getting Started

1 Prepare tenant-specific config files

All example config files are located in:

roles/container_homepage/files/

👉 Copy these files to your inventory directory under the following structure:

inventory/[TENANT]/host_files/[HOST]/container_homepage_config_files/

Example:

inventory/tenant1/host_files/docker1/container_homepage_config_files/bookmarks.yaml
inventory/tenant1/host_files/docker1/container_homepage_config_files/settings.yaml
...

⚠️ Customize these files before deploying, according to the requirements of your tenant and host.


⚙️ Default Variables

These are defined in defaults/main.yml:

container_homepage_version: latest
container_homepage_domain: dashboard.example.com
container_homepage_directory: /opt/docker/homepage
container_homepage_config_files:
  - src: "{{ inventory_dir }}/host_files/{{ inventory_hostname }}/container_homepage_config_files/bookmarks.yaml"
    dest: "bookmarks.yaml"
  - src: "{{ inventory_dir }}/host_files/{{ inventory_hostname }}/container_homepage_config_files/settings.yaml"
    dest: "settings.yaml"
  - src: "{{ inventory_dir }}/host_files/{{ inventory_hostname }}/container_homepage_config_files/custom.css"
    dest: "custom.css"
  - src: "{{ inventory_dir }}/host_files/{{ inventory_hostname }}/container_homepage_config_files/custom.js"
    dest: "custom.js"
  - src: "{{ inventory_dir }}/host_files/{{ inventory_hostname }}/container_homepage_config_files/docker.yaml"
    dest: "docker.yaml"
  - src: "{{ inventory_dir }}/host_files/{{ inventory_hostname }}/container_homepage_config_files/kubernetes.yaml"
    dest: "kubernetes.yaml"
  - src: "{{ inventory_dir }}/host_files/{{ inventory_hostname }}/container_homepage_config_files/services.yaml"
    dest: "services.yaml"
  - src: "{{ inventory_dir }}/host_files/{{ inventory_hostname }}/container_homepage_config_files/widgets.yaml"
    dest: "widgets.yaml"

📂 Inventory example

inventory/
└── tenant1/
    ├── hosts.yml
    └── host_files/
        └── docker1/
            └── container_homepage_config_files/
                ├── bookmarks.yaml
                ├── settings.yaml
                ├── custom.css
                ├── custom.js
                ├── docker.yaml
                ├── kubernetes.yaml
                ├── services.yaml
                └── widgets.yaml

📝 Usage

Run your playbook as usual:

ansible-playbook -i inventory/tenant1/inventory.yml playbooks/playbook.yml

The role will: Ensure directories exist Deploy Docker Compose and environment files Copy the tenant-specific configuration files Start or update the container


💡 Notes

  • The role expects Docker (with compose v2 plugin) to be installed on the target host.
  • The docker-compose and .env files should be templated or provided by your playbook or role.
  • Make sure the container_homepage_directory location has correct permissions for your user/container runtime.