Compare commits

..

6 commits

Author SHA1 Message Date
9dba002f10
maintenance(playbook): simplify nginx repo setup and install task name
All checks were successful
/ Ansible Lint (push) Successful in 1m45s
2025-02-18 05:48:52 +01:00
1ea63a19d3
maintenance(playbook): ensure docker repo and install before update
As with ensuring the nginx repo setup and install on relevant hosts, do
the same for docker.
2025-02-18 05:48:01 +01:00
7420ed6010
nginx(role): split up repo setup and install task lists to estab. conv.
Split up repo setup and package installation after all to establish this
as a convention (its already done this way in the docker role and was
done this way in the nginx role before) to highlight that an external
repo is used.
2025-02-18 05:43:39 +01:00
89f3e55eac
docker(role): use better naming 2025-02-18 05:35:45 +01:00
ce812fb006
docker(role): update README
Document Debian 12 support, enhance wording, bring structure in line
with the READMEs of more modern roles and remove unnecessary sections.
2025-02-18 05:33:30 +01:00
d62c070ccc
maintenance(playbook): fix playbook by using updated nginx role res. 2025-02-18 05:17:38 +01:00
10 changed files with 39 additions and 42 deletions

View file

@ -1,30 +1,28 @@
- name: Ensure NGINX repo and install on nginx_hosts - name: Ensure NGINX repo setup and nginx install on relevant hosts
hosts: nginx_hosts hosts: nginx_hosts:nextcloud_hosts
tasks: tasks:
- name: make sure NGINX repos are setup - name: Ensure NGINX repo is setup
ansible.builtin.include_role: ansible.builtin.include_role:
name: nginx name: nginx
tasks_from: main/repo_setup tasks_from: main/02_repo_setup.yaml
- name: make sure NGINX is installed - name: Ensure nginx is installed
ansible.builtin.include_role: ansible.builtin.include_role:
name: nginx name: nginx
tasks_from: main/nginx_install tasks_from: main/03_nginx_install.yaml
- name: Ensure NGINX repo and install on nextcloud_hosts - name: Ensure Docker repo setup and package install on relevant hosts
hosts: nextcloud_hosts:!nginx_hosts hosts: docker_compose_hosts:nextcloud_hosts
tasks: tasks:
- name: make sure NGINX repos are setup - name: Ensure Docker repo is setup
ansible.builtin.include_role: ansible.builtin.include_role:
name: nginx name: docker
tasks_from: main/repo_setup tasks_from: main/01_repo_setup.yaml
- name: make sure NGINX is installed - name: Ensure Docker Engine and other related packages are installed
ansible.builtin.include_role: ansible.builtin.include_role:
name: nginx name: docker
tasks_from: main/nginx_install tasks_from: main/02_docker_install.yaml
vars:
nginx__version_spec: "{{ nextcloud__nginx_version_spec | default('') }}"
- name: Make Sure System Package Are Up-To-Date for all non-hypervisors - name: Make Sure System Package Are Up-To-Date for all non-hypervisors
hosts: all:!hypervisors hosts: all:!hypervisors

View file

@ -1,26 +1,22 @@
# Role `docker` # Role `docker`
Makes sure Docker Engine and other related packages are installed from the Docker repos on the specified hosts. Ensures the Docker Engine and other related packages are installed from the Docker repos.
For details see: [`tasks/main/02_docker_install.yaml`](./tasks/main/02_docker_install.yaml). For detailed list of packages see: [`tasks/main/02_docker_install.yaml`](./tasks/main/02_docker_install.yaml).
## Supported Distributions ## Supported Distributions
The following distributions are supported: The following distributions are supported:
- Debian 11 - Debian 11
- Debian 12
## Required Arguments ## Required Arguments
None. None.
## Updates ## Optional Arguments
This role doesn't handle updates. None.
However it uses the system package manager for installing Docker Engine and the other related packages, so when you're making sure the system packages are up-to-date, you're handling updates for the packages installed by this role as well.
## `hosts`
The `hosts` for this role need to be the machines for which you want to make sure Docker Engine and other related packages are installed from the Docker repos.
## Links & Resources ## Links & Resources

View file

@ -1,11 +1,11 @@
- name: make sure the Docker repo is setup - name: Ensure Docker repo is setup
ansible.builtin.import_tasks: ansible.builtin.import_tasks:
file: main/01_repo_setup.yaml file: main/01_repo_setup.yaml
- name: make sure Docker Engine and other related packages are installed - name: Ensure Docker Engine and other related packages are installed
ansible.builtin.import_tasks: ansible.builtin.import_tasks:
file: main/02_docker_install.yaml file: main/02_docker_install.yaml
- name: configure the Docker daemon - name: Ensure Docker daemon configuration
ansible.builtin.import_tasks: ansible.builtin.import_tasks:
file: main/03_docker_config.yaml file: main/03_docker_config.yaml

View file

@ -1,4 +1,4 @@
- name: make sure Dockers GPG key is added - name: Ensure Dockers GPG key is added
ansible.builtin.get_url: ansible.builtin.get_url:
url: https://download.docker.com/linux/debian/gpg url: https://download.docker.com/linux/debian/gpg
dest: /etc/apt/trusted.gpg.d/docker.asc dest: /etc/apt/trusted.gpg.d/docker.asc
@ -7,7 +7,7 @@
group: root group: root
become: true become: true
- name: make sure Dockers APT repository is added - name: Ensure Docker APT repository is added
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/docker.asc] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable" repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/docker.asc] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
filename: docker filename: docker

View file

@ -1,4 +1,4 @@
- name: make sure Docker Engine and other related packages are installed - name: Ensure Docker Engine and other related packages are installed
ansible.builtin.apt: ansible.builtin.apt:
name: name:
- docker-ce - docker-ce

View file

@ -1,7 +1,7 @@
# Configure the Docker daemon with the following settings: # Ensure the Docker daemon is configured with the following settings:
# - log to systemd journal # - log to systemd journal
# https://docs.docker.com/engine/logging/drivers/journald/ # https://docs.docker.com/engine/logging/drivers/journald/
- name: configure Docker daemon - name: Ensure Docker daemon configuration
ansible.builtin.copy: ansible.builtin.copy:
src: daemon.json src: daemon.json
dest: /etc/docker/daemon.json dest: /etc/docker/daemon.json

View file

@ -2,10 +2,14 @@
ansible.builtin.import_tasks: ansible.builtin.import_tasks:
file: main/01_validate_config_names.yaml file: main/01_validate_config_names.yaml
- name: Ensure NGINX repo is set up
ansible.builtin.import_tasks:
file: main/02_repo_setup.yaml
- name: Ensure nginx is installed - name: Ensure nginx is installed
ansible.builtin.import_tasks: ansible.builtin.import_tasks:
file: main/02_nginx_install.yaml file: main/03_nginx_install.yaml
- name: Ensure configuration deployment - name: Ensure configuration deployment
ansible.builtin.import_tasks: ansible.builtin.import_tasks:
file: main/03_config_deploy.yaml file: main/04_config_deploy.yaml

View file

@ -37,10 +37,3 @@
group: root group: root
mode: "0644" mode: "0644"
become: true become: true
- name: Ensure nginx is installed
ansible.builtin.apt:
name: nginx
state: present
update_cache: true
become: true

View file

@ -0,0 +1,6 @@
- name: Ensure nginx is installed
ansible.builtin.apt:
name: nginx
state: present
update_cache: true
become: true