finish adding terraform and vault archive

This commit is contained in:
Matthew Stobbs
2025-03-22 17:36:09 -06:00
parent ed3cc1d560
commit 63a83f2ec3
8 changed files with 139 additions and 22 deletions

37
tasks/archive/vault.yml Normal file
View File

@@ -0,0 +1,37 @@
# vim: set filetype=yaml.ansible : ---
- name: Check if vault is already installed
register: r_vault_inst
ansible.builtin.stat:
path: "{{ vault.bin }}"
- name: Download and install vault
when:
- not r_vault_inst.stat.exists
block:
- name: Download vault archive
ansible.builtin.get_url:
dest: "{{ d_tempdir.path }}/{{ vault.archive }}"
url: "{{ vault.url }}/{{ vault.archive }}"
mode: '0644'
decompress: false
- name: Ensure vault archive dir exists
become: "{{ ext_become }}"
ansible.builtin.file:
state: directory
path: "{{ vault.path }}"
mode: '0755'
- name: Extract vault archive
become: "{{ ext_become }}"
ansible.builtin.unarchive:
dest: "{{ vault.path }}"
src: "{{ d_tempdir.path }}/{{ vault.archive }}"
remote_src: true
- name: Link vault executable
become: "{{ ext_become }}"
ansible.builtin.file:
state: link
src: "{{ vault.path }}/vault"
path: "{{ vault.bin }}"