Files

92 lines
2.3 KiB
YAML
Raw Permalink Normal View History

2026-09-07 17:59:51 +00:00
---
2026-09-08 01:07:23 +00:00
- name: Validate the supported platform
ansible.builtin.assert:
that:
- ansible_facts.distribution == "Ubuntu"
- ansible_facts.distribution_version == "26.04"
- ansible_facts.architecture in ["x86_64", "aarch64"]
fail_msg: Seriatim supports Ubuntu 26.04 on x86_64 or aarch64.
2026-09-08 01:07:23 +00:00
- name: Install Git
2026-09-08 02:08:35 +00:00
become: true
2026-09-08 01:07:23 +00:00
ansible.builtin.apt:
name: git
state: present
update_cache: true
2026-09-08 02:08:35 +00:00
cache_valid_time: 3600
2026-09-08 01:07:23 +00:00
when: seriatim_manage_build_dependencies
2026-09-08 01:07:23 +00:00
- name: Install Go
2026-09-08 02:08:35 +00:00
become: true
2026-09-08 01:07:23 +00:00
community.general.snap:
name: go
channel: "{{ seriatim_go_snap_channel }}"
classic: true
state: present
when: seriatim_manage_build_dependencies
2026-09-08 01:07:23 +00:00
- name: Create installation parent directories
2026-09-08 02:08:35 +00:00
become: true
2026-09-08 01:07:23 +00:00
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: "0755"
loop:
- "{{ seriatim_source_dir | dirname }}"
- "{{ seriatim_binary_path | dirname }}"
- name: Check out Seriatim source
2026-09-08 02:08:35 +00:00
become: true
2026-09-08 01:07:23 +00:00
ansible.builtin.git:
repo: "{{ seriatim_repository_url }}"
dest: "{{ seriatim_source_dir }}"
version: "{{ seriatim_version }}"
force: true
register: seriatim_checkout
- name: Inspect the installed binary
ansible.builtin.stat:
path: "{{ seriatim_binary_path }}"
register: seriatim_binary
- name: Build Seriatim
2026-09-08 02:08:35 +00:00
become: true
2026-09-08 01:07:23 +00:00
ansible.builtin.command:
argv:
2026-09-08 02:08:35 +00:00
- "{{ seriatim_go_binary }}"
2026-09-08 01:07:23 +00:00
- build
- -trimpath
- -ldflags
- "-s -w -X gitea.maximumdirect.net/eric/seriatim/internal/buildinfo.Version={{ seriatim_version }}"
- -o
- "{{ seriatim_binary_path }}"
- ./cmd/seriatim
chdir: "{{ seriatim_source_dir }}"
environment:
CGO_ENABLED: "0"
GOTOOLCHAIN: local
GOWORK: "off"
changed_when: true
when: >-
seriatim_checkout.changed or
2026-09-08 02:08:35 +00:00
not seriatim_binary.stat.exists
2026-09-08 01:07:23 +00:00
- name: Converge installed metadata
2026-09-08 02:08:35 +00:00
become: true
2026-09-08 01:07:23 +00:00
ansible.builtin.file:
path: "{{ item.path }}"
state: "{{ item.state }}"
owner: root
group: root
mode: "{{ item.mode | default(omit) }}"
recurse: "{{ item.recurse | default(omit) }}"
loop:
- path: "{{ seriatim_source_dir }}"
state: directory
recurse: true
- path: "{{ seriatim_binary_path }}"
state: file
mode: "0755"