add some rpm packages and more idempotency

This commit is contained in:
Bartal Laearsson
2026-07-05 11:56:23 +01:00
parent 7e13ac8d6b
commit 4d58d02c2e
6 changed files with 96 additions and 10 deletions
+1
View File
@@ -40,3 +40,4 @@
when: install_typora
- ansible.builtin.import_tasks: tasks/duckdb.yml
when: install_duckdb
- ansible.builtin.import_tasks: tasks/rpm.yml
+9 -1
View File
@@ -1,16 +1,22 @@
---
- name: Stat DuckDB CLI installation
ansible.builtin.stat:
path: /usr/local/bin/duckdb
register: duckdb_installed_result
- name: Download DuckDB CLI
ansible.builtin.get_url:
url: "https://install.duckdb.org/v{{ duckdb_version }}/duckdb_cli-linux-amd64.gz"
dest: /tmp/duckdb_cli-linux-amd64.gz
mode: "0644"
timeout: 300
when: not duckdb_installed_result.stat.exists
- name: Install DuckDB CLI
ansible.builtin.shell: gzip -dc /tmp/duckdb_cli-linux-amd64.gz > /usr/local/bin/duckdb
args:
executable: /bin/bash
creates: /usr/local/bin/duckdb
when: not duckdb_installed_result.stat.exists
- name: Make DuckDB executable
ansible.builtin.file:
@@ -18,8 +24,10 @@
mode: "0755"
owner: root
group: root
when: not duckdb_installed_result.stat.exists
- name: Remove DuckDB archive
ansible.builtin.file:
path: /tmp/duckdb_cli-linux-amd64.gz
state: absent
when: not duckdb_installed_result.stat.exists
+53
View File
@@ -0,0 +1,53 @@
- name: Stat Proton Pass installation
ansible.builtin.command: rpm -qa proton-pass
register: proton_pass_installed_result
changed_when: false
failed_when: false
- name: Download Proton Pass
ansible.builtin.get_url:
url: "https://proton.me/download/pass/linux/proton-pass-{{ proton_pass_version }}.x86_64.rpm"
dest: "/tmp/proton-pass-{{ proton_pass_version }}.x86_64.rpm"
mode: "0644"
timeout: 300
when: "proton_pass_installed_result.rc != 0"
- name: Install Proton Pass
ansible.builtin.dnf:
name: "/tmp/proton-pass-{{ proton_pass_version }}.x86_64.rpm"
state: present
disable_gpg_check: yes
when: "proton_pass_installed_result.rc != 0"
- name: Stat Proton Authenticator installation
ansible.builtin.command: rpm -qa proton-authenticator
register: proton_authenticator_installed_result
changed_when: false
failed_when: false
- name: Download Proton Authenticator
ansible.builtin.get_url:
url: "https://proton.me/download/authenticator/linux/ProtonAuthenticator-{{ proton_authenticator_version }}.x86_64.rpm"
dest: "/tmp/proton-authenticator-{{ proton_authenticator_version }}.x86_64.rpm"
mode: "0644"
timeout: 300
when: "proton_authenticator_installed_result.rc != 0"
- name: Install Proton Authenticator
ansible.builtin.dnf:
name: "/tmp/proton-authenticator-{{ proton_authenticator_version }}.x86_64.rpm"
state: present
disable_gpg_check: yes
when: "proton_authenticator_installed_result.rc != 0"
- name: Delete Proton Pass downloaded RPM
ansible.builtin.file:
path: "/tmp/proton-pass-{{ proton_pass_version }}.x86_64.rpm"
state: absent
when: "proton_pass_installed_result.rc != 0"
- name: Delete Proton Authenticator downloaded RPM
ansible.builtin.file:
path: "/tmp/proton-authenticator-{{ proton_authenticator_version }}.x86_64.rpm"
state: absent
when: "proton_authenticator_installed_result.rc != 0"
+14 -2
View File
@@ -91,9 +91,15 @@
when: not starship_binary.stat.exists
- name: Run Starship installer
ansible.builtin.command: /tmp/install_starship.sh -y
ansible.builtin.command: /tmp/install_starship.sh -y --bin-dir "{{ user_home }}/.local/bin"
become: false
when: not starship_binary.stat.exists
- name: Remove the Starship installer
ansible.builtin.file:
path: /tmp/install_starship.sh
state: absent
when: not starship_binary.stat.exists
become: true
- name: Check for Bun
ansible.builtin.stat:
@@ -112,3 +118,9 @@
ansible.builtin.command: /tmp/bun-install.sh
become: false
when: not bun_binary.stat.exists
- name: Remove the Bun installer
ansible.builtin.file:
path: /tmp/bun-install.sh
state: absent
when: not bun_binary.stat.exists
+17 -7
View File
@@ -1,4 +1,8 @@
---
- name: Stat Typora installation directory
ansible.builtin.stat:
path: /opt/typora
register: typora_installed_result
- name: Create Typora install directory
ansible.builtin.file:
path: /opt/typora
@@ -6,6 +10,7 @@
owner: root
group: root
mode: "0755"
when: not typora_installed_result.stat.exists
- name: Download Typora Linux binary archive
ansible.builtin.get_url:
@@ -13,6 +18,7 @@
dest: "{{ typora_archive }}"
mode: "0644"
timeout: 300
when: not typora_installed_result.stat.exists
- name: Extract Typora
ansible.builtin.unarchive:
@@ -22,6 +28,7 @@
owner: root
group: root
mode: "0755"
when: not typora_installed_result.stat.exists
- name: Ensure Typora files are readable
ansible.builtin.file:
@@ -31,6 +38,13 @@
group: root
mode: "0755"
recurse: true
when: not typora_installed_result.stat.exists
- name: Ensure system desktop application directory exists
ansible.builtin.file:
path: /usr/local/share/applications
state: directory
mode: "0755"
- name: Create Typora launcher wrapper
ansible.builtin.copy:
@@ -42,12 +56,7 @@
cd /opt/typora/bin/Typora-linux-x64
exec /opt/typora/bin/Typora-linux-x64/Typora "$@"
- name: Ensure system desktop application directory exists
ansible.builtin.file:
path: /usr/local/share/applications
state: directory
mode: "0755"
when: not typora_installed_result.stat.exists
- name: Create Typora desktop launcher
ansible.builtin.copy:
@@ -62,3 +71,4 @@
Terminal=false
Categories=Office;WordProcessor;TextEditor;
MimeType=text/markdown;text/x-markdown;
when: not typora_installed_result.stat.exists
+2
View File
@@ -14,6 +14,8 @@ jdtls_download_retries: 3
jdtls_download_delay: 10
install_duckdb: true
duckdb_version: "1.5.2"
proton_pass_version: "1.37.0-1"
proton_authenticator_version: "1.1.6-1"
system_timezone: Atlantic/Faroe
system_locale: en_US.UTF-8