Skip to content

Commit

Permalink
Update role to support atuin 18.3.0
Browse files Browse the repository at this point in the history
Atuin 18.3.0 changed the artifact name on GitHub. This update fixes the
role to handle the new naming, as well as keeping support for the old
artifact names.
  • Loading branch information
wzzrd committed Jun 12, 2024
1 parent 3cdc7bb commit 933ecb6
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.0]

#### Added

- Support for atuin 18.3.0 (which changed the artifact naming convention)

## [2.0.2]

#### Added
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: wzzrd
name: atuin

# The version of the collection. Must be compatible with semantic versioning
version: "2.0.3"
version: "2.1.0"

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
2 changes: 1 addition & 1 deletion roles/atuin_client/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
roles:
- role: atuin_client
vars:
atuin_client_version: 18.0.0
atuin_client_version: 18.3.0
atuin_client_users:
- johnc
54 changes: 51 additions & 3 deletions roles/atuin_client/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
- debug is defined
- debug

- name: Download and install new binary, if needed
when: (detected_version is not defined) or
(atuin_client_version != detected_version)
- name: Download and install new binary, if needed, for old atuin
when:

Check failure on line 38 in roles/atuin_client/tasks/main.yml

View workflow job for this annotation

GitHub Actions / lint-all-files

yaml[trailing-spaces]

Trailing spaces
- (detected_version is not defined) or
(atuin_client_version != detected_version)
- atuin_client_version is version('18.3.0', '<')
tags:
- version
block:
Expand Down Expand Up @@ -78,6 +80,52 @@
path: /tmp/atuin-v{{ atuin_client_version }}-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}
state: absent

- name: Download and install new binary, if needed, for new atuin
when:

Check failure on line 84 in roles/atuin_client/tasks/main.yml

View workflow job for this annotation

GitHub Actions / lint-all-files

yaml[trailing-spaces]

Trailing spaces
- (detected_version is not defined) or
(atuin_client_version != detected_version)
- atuin_client_version is version('18.3.0', '>=')
tags:
- version
block:
- name: Formulate artifact name
ansible.builtin.set_fact:
atuin_client_artifact: atuin-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}.tar.gz # noqa yaml[line-length]

- name: Show artifact name
ansible.builtin.debug:
msg: "{{ atuin_client_artifact }}"
when:
- debug is defined
- debug

- name: Download and untar requested release
ansible.builtin.unarchive:
src: https://github.com/atuinsh/atuin/releases/download/v{{ atuin_client_version }}/{{ atuin_client_artifact }} # noqa yaml[line-length].
remote_src: true
dest: "/tmp"
include: "atuin-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}/atuin" # noqa yaml[line-length]
owner: root
group: root
mode: "0755"

- name: Copy atuin to final location
ansible.builtin.copy:
src: /tmp/atuin-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}/atuin # noqa yaml[line-length]
dest: "{{ atuin_client_bin_dir }}"
remote_src: true
owner: root
group: root
mode: "0755"
notify:
- Gather service facts
- Restart atuin service

- name: Remove download directory
ansible.builtin.file:
path: /tmp/atuin-{{ ansible_architecture }}-unknown-linux-{{ atuin_client_libc_variant }}
state: absent

- name: Configure atuin client
ansible.builtin.include_tasks: users.yml
loop: "{{ atuin_client_users }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/atuin_server/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# have python installed in order to avoid notable delays installing it.
gather_facts: false
vars:
atuin_client_version: 18.0.1
atuin_client_version: 18.3.0
atuin_server_db_uri: "postgres://atuin:atuin@{{ atuin_server_host }}/atuin"

pre_tasks:
Expand Down

0 comments on commit 933ecb6

Please sign in to comment.