feat: initial commit
This commit is contained in:
commit
3f0a878c3a
18 changed files with 321 additions and 0 deletions
54
tasks/install.yaml
Normal file
54
tasks/install.yaml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
|
||||
# check current atuin version
|
||||
- name: "check current version"
|
||||
ansible.builtin.shell:
|
||||
cmd: "/usr/local/bin/atuin -V"
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
register: "atuin_version_check"
|
||||
|
||||
# download atuin
|
||||
- name: "download atuin"
|
||||
ansible.builtin.get_url:
|
||||
url:
|
||||
"https://github.com/atuinsh/atuin/releases/download/\
|
||||
v{{ atuin_version }}/atuin-x86_64-unknown-linux-gnu.tar.gz"
|
||||
dest: "/tmp/"
|
||||
checksum:
|
||||
"sha256:https://github.com/atuinsh/atuin/releases/download/\
|
||||
v{{ atuin_version }}/atuin-x86_64-unknown-linux-gnu.tar.gz.sha256"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0775"
|
||||
when: "atuin_version not in atuin_version_check.stdout"
|
||||
register: "atuin_download"
|
||||
|
||||
# install atuin
|
||||
- name: "install atuin"
|
||||
ansible.builtin.unarchive:
|
||||
src: "/tmp/atuin-x86_64-unknown-linux-gnu.tar.gz"
|
||||
dest: "/usr/local/bin/"
|
||||
include: "atuin"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0755"
|
||||
remote_src: true
|
||||
when: "atuin_download.changed"
|
||||
|
||||
# install systemd service
|
||||
- name: "install service"
|
||||
ansible.builtin.template:
|
||||
src: "templates/systemd/atuin.service.j2"
|
||||
dest: "/etc/systemd/system/atuin.service"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
notify: "restart atuin"
|
||||
|
||||
# cleanup atuin
|
||||
- name: "cleanup atuin installer"
|
||||
ansible.builtin.file:
|
||||
path: "/tmp/atuin-x86_64-unknown-linux-gnu.tar.gz"
|
||||
state: "absent"
|
||||
when: "atuin_download.changed"
|
||||
Loading…
Add table
Add a link
Reference in a new issue