added alpine support

added check to bail if host not an amd64 architecture
This commit is contained in:
Radar231 2022-01-03 10:40:59 -05:00
parent d4af4a8aab
commit cf93836737
1 changed files with 35 additions and 6 deletions

View File

@ -10,18 +10,47 @@
###########################################################
# tasks file for sops
- name: Retrieve the mozilla sops deb package from github
#######################################
# Check for host architecture, and exit if not amd64
- name: Checking architecture - only amd64 supported
fail: msg="Only the amd64 architecture is supported for sops binary releases"
when: ansible_architecture != "x86_64"
#######################################
- name: Retrieve the mozilla sops deb package from github (Debian based distro)
get_url:
url: "https://github.com/mozilla/sops/releases/download/{{ sops_ver }}/{{ sops_pkg }}"
dest: "/tmp/{{ sops_pkg }}"
url: "https://github.com/mozilla/sops/releases/download/v{{ sops_ver }}/sops_{{ sops_ver }}_amd64.deb"
dest: "/tmp/sops-{{ sops_ver }}_amd64.deb"
mode: "0644"
owner: root
group: root
when: ansible_os_family == "Debian" and ansible_architecture == "x86_64"
- name: Install sops deb package
#######################################
- name: Retrieve the mozilla sops linux binary file from github (Alpine)
get_url:
url: "https://github.com/mozilla/sops/releases/download/v{{ sops_ver }}/sops-{{ sops_ver }}.linux"
dest: "/usr/local/bin/sops-{{ sops_ver }}.linux"
mode: "0755"
owner: root
group: root
when: ansible_distribution == "Alpine" and ansible_architecture == "x86_64"
#######################################
- name: Install sops deb package (Debian based distro)
apt:
deb: "/tmp/{{ sops_pkg }}"
deb: "/tmp/sops-{{ sops_ver }}_amd64.deb"
state: present
when: ansible_os_family == "Debian"
when: ansible_os_family == "Debian" and ansible_architecture == "x86_64"
#######################################
- name: create symlink for sops binary (Alpine)
file:
src: "/usr/local/bin/sops-{{ sops_ver }}.linux"
dest: "/usr/local/bin/sops"
owner: root
group: root
mode: "0755"
when: ansible_distribution == "Alpine" and ansible_architecture == "x86_64"
# EOF