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
+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"