feat: initial commit

This commit is contained in:
Simon Cornet 2026-05-08 08:34:04 +02:00
commit 3063fd9b39
15 changed files with 242 additions and 93 deletions

35
tasks/config.yaml Normal file
View file

@ -0,0 +1,35 @@
---
# configure zot
- name: "configure zot"
block:
# create config file
- name: "create config file"
ansible.builtin.template:
src: "zot/config.json.j2"
dest: "/etc/zot/config.json"
owner: "root"
group: "root"
mode: "0644"
# configure service for debian
- name: "configure service for debian"
when: "ansible_os_family == 'Debian'"
block:
# create systemd service
- name: "create systemd service"
ansible.builtin.template:
src: "zot/zot.service.j2"
dest: "/etc/systemd/system/zot.service"
owner: "root"
group: "root"
mode: "0644"
# enable and start service
- name: "enable and start zot service"
ansible.builtin.systemd:
name: "zot.service"
enabled: true
state: "started"

28
tasks/install.yaml Normal file
View file

@ -0,0 +1,28 @@
---
# install zot
- name: "install zot"
when: "zot_major_version not in zot_current_version.stdout"
block:
# install zot
- name: "install zot"
ansible.builtin.unarchive:
src: "https://github.com/project-zot/zot/releases/download/v{{ zot_version }}/zot-linux-amd64"
dest: "/usr/bin/zot"
owner: "root"
group: "root"
mode: "0755"
remote_src: true
# create zot dirs
- name: "create zot dirs"
ansible.builtin.file:
path: "{{ item }}"
state: "directory"
owner: "root"
group: "root"
mode: "0755"
loop:
- "/etc/zot"
- "/var/lib/zot"

23
tasks/main.yaml Normal file
View file

@ -0,0 +1,23 @@
---
# load variables and collect version information
- name: "include vars and collect versions"
block:
# collect zot version information
- name: "collect version information"
ansible.builtin.shell:
cmd: "zot --version | head -n 1"
changed_when: false
failed_when: false
ignore_errors: true
register: "zot_current_version"
# zot install
- name: "zot install"
ansible.builtin.include_tasks: "install.yaml"
# zot config
- name: "zot config"
ansible.builtin.include_tasks: "config.yaml"