add some rpm packages and more idempotency
This commit is contained in:
@@ -40,3 +40,4 @@
|
|||||||
when: install_typora
|
when: install_typora
|
||||||
- ansible.builtin.import_tasks: tasks/duckdb.yml
|
- ansible.builtin.import_tasks: tasks/duckdb.yml
|
||||||
when: install_duckdb
|
when: install_duckdb
|
||||||
|
- ansible.builtin.import_tasks: tasks/rpm.yml
|
||||||
|
|||||||
+9
-1
@@ -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
|
- name: Download DuckDB CLI
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: "https://install.duckdb.org/v{{ duckdb_version }}/duckdb_cli-linux-amd64.gz"
|
url: "https://install.duckdb.org/v{{ duckdb_version }}/duckdb_cli-linux-amd64.gz"
|
||||||
dest: /tmp/duckdb_cli-linux-amd64.gz
|
dest: /tmp/duckdb_cli-linux-amd64.gz
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
timeout: 300
|
timeout: 300
|
||||||
|
when: not duckdb_installed_result.stat.exists
|
||||||
|
|
||||||
- name: Install DuckDB CLI
|
- name: Install DuckDB CLI
|
||||||
ansible.builtin.shell: gzip -dc /tmp/duckdb_cli-linux-amd64.gz > /usr/local/bin/duckdb
|
ansible.builtin.shell: gzip -dc /tmp/duckdb_cli-linux-amd64.gz > /usr/local/bin/duckdb
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
creates: /usr/local/bin/duckdb
|
creates: /usr/local/bin/duckdb
|
||||||
|
when: not duckdb_installed_result.stat.exists
|
||||||
|
|
||||||
- name: Make DuckDB executable
|
- name: Make DuckDB executable
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@@ -18,8 +24,10 @@
|
|||||||
mode: "0755"
|
mode: "0755"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
when: not duckdb_installed_result.stat.exists
|
||||||
|
|
||||||
- name: Remove DuckDB archive
|
- name: Remove DuckDB archive
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /tmp/duckdb_cli-linux-amd64.gz
|
path: /tmp/duckdb_cli-linux-amd64.gz
|
||||||
state: absent
|
state: absent
|
||||||
|
when: not duckdb_installed_result.stat.exists
|
||||||
|
|||||||
@@ -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
@@ -91,9 +91,15 @@
|
|||||||
when: not starship_binary.stat.exists
|
when: not starship_binary.stat.exists
|
||||||
|
|
||||||
- name: Run Starship installer
|
- 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
|
when: not starship_binary.stat.exists
|
||||||
become: true
|
|
||||||
|
|
||||||
- name: Check for Bun
|
- name: Check for Bun
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
@@ -112,3 +118,9 @@
|
|||||||
ansible.builtin.command: /tmp/bun-install.sh
|
ansible.builtin.command: /tmp/bun-install.sh
|
||||||
become: false
|
become: false
|
||||||
when: not bun_binary.stat.exists
|
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
@@ -1,4 +1,8 @@
|
|||||||
---
|
- name: Stat Typora installation directory
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /opt/typora
|
||||||
|
register: typora_installed_result
|
||||||
|
|
||||||
- name: Create Typora install directory
|
- name: Create Typora install directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /opt/typora
|
path: /opt/typora
|
||||||
@@ -6,6 +10,7 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when: not typora_installed_result.stat.exists
|
||||||
|
|
||||||
- name: Download Typora Linux binary archive
|
- name: Download Typora Linux binary archive
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
@@ -13,6 +18,7 @@
|
|||||||
dest: "{{ typora_archive }}"
|
dest: "{{ typora_archive }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
timeout: 300
|
timeout: 300
|
||||||
|
when: not typora_installed_result.stat.exists
|
||||||
|
|
||||||
- name: Extract Typora
|
- name: Extract Typora
|
||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
@@ -22,6 +28,7 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when: not typora_installed_result.stat.exists
|
||||||
|
|
||||||
- name: Ensure Typora files are readable
|
- name: Ensure Typora files are readable
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@@ -31,6 +38,13 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
recurse: true
|
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
|
- name: Create Typora launcher wrapper
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
@@ -42,12 +56,7 @@
|
|||||||
|
|
||||||
cd /opt/typora/bin/Typora-linux-x64
|
cd /opt/typora/bin/Typora-linux-x64
|
||||||
exec /opt/typora/bin/Typora-linux-x64/Typora "$@"
|
exec /opt/typora/bin/Typora-linux-x64/Typora "$@"
|
||||||
|
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 desktop launcher
|
- name: Create Typora desktop launcher
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
@@ -62,3 +71,4 @@
|
|||||||
Terminal=false
|
Terminal=false
|
||||||
Categories=Office;WordProcessor;TextEditor;
|
Categories=Office;WordProcessor;TextEditor;
|
||||||
MimeType=text/markdown;text/x-markdown;
|
MimeType=text/markdown;text/x-markdown;
|
||||||
|
when: not typora_installed_result.stat.exists
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ jdtls_download_retries: 3
|
|||||||
jdtls_download_delay: 10
|
jdtls_download_delay: 10
|
||||||
install_duckdb: true
|
install_duckdb: true
|
||||||
duckdb_version: "1.5.2"
|
duckdb_version: "1.5.2"
|
||||||
|
proton_pass_version: "1.37.0-1"
|
||||||
|
proton_authenticator_version: "1.1.6-1"
|
||||||
|
|
||||||
system_timezone: Atlantic/Faroe
|
system_timezone: Atlantic/Faroe
|
||||||
system_locale: en_US.UTF-8
|
system_locale: en_US.UTF-8
|
||||||
|
|||||||
Reference in New Issue
Block a user