feat(drivestrike): add role to install on archlinux

This commit is contained in:
Johanna Dorothea Reichmann 2022-08-22 18:50:18 +02:00
parent 63bdce3f34
commit 9476a8df61
No known key found for this signature in database
GPG key ID: 03624C433676E465
3 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,11 @@
---
drivestrike_package_name: drivestrike
drivestrike_package_name_arch: "{{ drivestrike_package_name }}"
drivestrike_arch_pubkey_url: "https://app.drivestrike.com/static/drivestrike.pubkey.txt"
drivestrike_arch_pubkey_file: "/tmp/drivestrike.pub"
drivestrike_arch_pubkey_id: 6B48829B
drivestrike_arch_pubkey_fingerprint: A9CA32527A44BC385FCAEF85441FF83A6B48829B
drivestrike_arch_repo_server_url: "https://app.drivestrike.com/static/arch"
drivestrike_arch_pacman_config_file: /etc/pacman.conf

View file

@ -0,0 +1,42 @@
---
- name: Ensure dependencies are installed
pacman:
name: "{{ item }}"
state: present
loop:
- gnupg
- name: Retrieve pacman repository key
uri:
method: GET
url: "{{ drivestrike_arch_pubkey_url }}"
dest: "{{ drivestrike_arch_pubkey_file }}"
register: drivestrik_pub_key_download
- name: Import drivestrike public key
community.general.pacman_key:
id: "{{ drivestrike_arch_pubkey_fingerprint }}"
file: "{{ drivestrike_arch_pubkey_file }}"
verify: true
state: present
when: drivestrik_pub_key_download.changed
- name: Configure pacman for external repositoy
blockinfile:
dest: "{{ drivestrike_arch_pacman_config_file }}"
marker: "# {mark} ANSIBLE MANAGED BLOCK by famedly.services.drivestrike"
block: |+2
[drivestrike]
SigLevel = Required DatabaseOptional
Server = {{ drivestrike_arch_repo_server_url }}
- name: Update pacman cache
pacman:
update_cache: true
when: drivestrik_pub_key_download.changed
- name: Install drivestrike package
pacman:
name: "{{ drivestrike_package_name_arch }}"
state: present

View file

@ -0,0 +1,5 @@
---
- name: Install drivestrike
include_tasks:
file: "install-{{ ansible_os_family }}.yml"