role_age/tasks/main.yml

69 lines
1.9 KiB
YAML

---
###########################################################
#
# This role will install the age encryption application.
#
# requires that the following variables be set;
# - 'age_ver' - the desired verion (ie, 1.0.0)
#
###########################################################
# tasks file for sops
#######################################
- name: Retrieve the age tar file from github (amd64)
get_url:
url: "https://github.com/FiloSottile/age/releases/download/v{{ age_ver }}/age-v{{ age_ver }}-linux-amd64.tar.gz"
dest: "/tmp/age-v{{ age_ver }}-linux-amd64.tar.gz"
mode: "0644"
owner: root
group: root
when: ansible_architecture == "x86_64"
#######################################
- name: Retrieve the age tar file from github (aarch64)
get_url:
url: "https://github.com/FiloSottile/age/releases/download/v{{ age_ver }}/age-v{{ age_ver }}-linux-arm64.tar.gz"
dest: "/tmp/age-v{{ age_ver }}-linux-arm64.tar.gz"
mode: "0644"
owner: root
group: root
when: ansible_architecture == "aarch64"
#######################################
- name: Unarchive age tar file in /tmp (amd64)
unarchive:
src: "/tmp/age-v{{ age_ver }}-linux-amd64.tar.gz"
dest: /tmp
remote_src: yes
when: ansible_architecture == "x86_64"
#######################################
- name: Unarchive age tar file in /tmp (aarch64)
unarchive:
src: "/tmp/age-v{{ age_ver }}-linux-arm64.tar.gz"
dest: /tmp
remote_src: yes
when: ansible_architecture == "aarch64"
#######################################
- name: copy age-keygen to /usr/local/bin
copy:
src: /tmp/age/age-keygen
dest: /usr/local/bin/age-keygen
owner: root
group: root
mode: "0755"
remote_src: yes
#######################################
- name: copy age to /usr/local/bin
copy:
src: /tmp/age/age
dest: /usr/local/bin/age
owner: root
group: root
mode: "0755"
remote_src: yes
# EOF