dockerhost/deploy.yml

46 lines
964 B
YAML
Raw Normal View History

2025-03-10 19:04:20 +01:00
---
2025-03-10 21:13:19 +01:00
# - hosts: all
# tasks:
# - name: Print message
# debug:
# msg: Hello Ansible World
2025-03-10 19:04:20 +01:00
- hosts: all
2025-03-10 21:13:19 +01:00
become: true
2025-03-10 19:04:20 +01:00
tasks:
2025-03-10 21:13:19 +01:00
## Docker
#
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu jammy stable
state: present
- name: Update apt and install docker-ce
apt:
name: docker-ce
state: latest
update_cache: true
- name: install pip3
apt:
name: python3-pip
state: latest
2025-03-10 21:55:16 +01:00
- name: add docker rules to ufw
blockinfile:
path: /etc/ufw/after.rules
marker_begin: BEGIN UFW AND DOCKER
marker_end: END UFW AND DOCKER
state: present
block: "{{ lookup('ansible.builtin.file', 'ufw-docker.rules') }}"
tags:
- ufw