From 449c55d29911881f3afc1c1ba7aebffdea3994e2 Mon Sep 17 00:00:00 2001 From: Marius Alwan Meyer <22202402+Sporqist@users.noreply.github.com> Date: Fri, 14 Oct 2022 15:08:14 +0200 Subject: [PATCH] initial commit --- tasks/main.yaml | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tasks/main.yaml diff --git a/tasks/main.yaml b/tasks/main.yaml new file mode 100644 index 0000000..20a09dd --- /dev/null +++ b/tasks/main.yaml @@ -0,0 +1,52 @@ + +--- +- name: Install Dependencies + apt: + pkg: + - apparmor + - docker.io + - python3-docker + +- name: Create Data Directory + file: + path: /data + state: directory + owner: 1000 + group: 1000 + mode: '0755' + +- name: Create Config Directory + file: + path: /config + state: directory + owner: 1000 + group: 1000 + mode: '0755' + +- name: Start Docker Daemon + systemd: + name: docker + enabled: yes + state: started + +- name: Create Gitea container + community.docker.docker_container: + name: gitea + image: "gitea/gitea:{{ gitea_version }}-rootless" + comparisons: + image: strict + volumes: strict + env: strict + restart_policy: unless-stopped + volumes: + - /data:/var/lib/gitea + - /config:/etc/gitea + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "3000:3000" + - "22:2222" + + + +