feat(setup-reverse-proxy.yml): install of certbot and nginx

This commit is contained in:
Lenoctambule
2026-03-10 20:46:27 +01:00
parent 0390901233
commit 237153d02b
3 changed files with 28 additions and 2 deletions

View File

@@ -0,0 +1,61 @@
- name: Installing Docker and Docker Compose
hosts: hosts
become: true
tasks:
- name: Clear previous install of Docker
ansible.builtin.apt:
name:
- docker.io
- docker-compose
- docker-compose-v2
- docker-doc
- podman-docker
- containerd
state: absent
autoremove: true
force: true
- name: Install pre-requirements
ansible.builtin.apt:
update_cache: yes
pkg:
- ca-certificates
- curl
force: true
- name: Add Docker GPG key and Repository
block:
- name: Download GPG Key
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
dest: /etc/apt/keyrings/docker.asc
- name: Add Docker repository source
ansible.builtin.template:
src: docker.sources.j2
dest: /etc/apt/sources.list.d/docker.sources
owner: root
group: root
mode: '0644'
- name: Update apt cache after adding Docker repository
ansible.builtin.apt:
update_cache: yes
- name: Install Docker and Docker Compose
ansible.builtin.apt:
state: present
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
force: true
- name: Install
ansible.builtin.user:
name: "{{ ansible_user_id }}"
groups: docker
append: yes

View File

@@ -0,0 +1,25 @@
- name: Setting up reverse proxy and load balancer
hosts: hosts
become: true
tasks:
- name: Install Certbot and Nginx
block:
- name: Installing Python3 and PIP
ansible.builtin.apt:
state: present
update_cache: yes
pkg:
- nginx
- python3-pip
- python3
- python3-dev
- python3-venv
- libaugeas-dev
- gcc
- name: Installing Certbot
ansible.builtin.pip:
name:
- certbot
- certbox-nginx