finish adding terraform and vault archive
This commit is contained in:
@@ -15,14 +15,14 @@
|
|||||||
url: "{{ pulumi.dlurl }}"
|
url: "{{ pulumi.dlurl }}"
|
||||||
decompress: false
|
decompress: false
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
|
|
||||||
- name: Extract pulumi archive
|
- name: Extract pulumi archive
|
||||||
become: "{{ ext_become }}"
|
become: "{{ ext_become }}"
|
||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
dest: "{{ path.archive }}"
|
dest: "{{ path.archive }}"
|
||||||
src: "{{ d_tempdir.path }}/{{ pulumi.archive }}"
|
src: "{{ d_tempdir.path }}/{{ pulumi.archive }}"
|
||||||
remote_src: true
|
remote_src: true
|
||||||
|
|
||||||
- name: Link pulumi executable
|
- name: Link pulumi executable
|
||||||
become: "{{ ext_become }}"
|
become: "{{ ext_become }}"
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|||||||
@@ -1,13 +1,38 @@
|
|||||||
- name: Download terraform archive
|
# vim: set filetype=yaml.ansible :
|
||||||
ansible.builtin.get_url:
|
---
|
||||||
dest: "{{ d_tempdir.path }}/{{ terraform.file }}"
|
- name: Check if terraform is already installed
|
||||||
url: "{{ terraform.url }}/{{ terraform.file }}"
|
register: r_terraform_inst
|
||||||
decompress: false
|
ansible.builtin.stat:
|
||||||
mode: '0644'
|
path: "{{ terraform.bin }}"
|
||||||
|
|
||||||
- name: Extract terraform archive
|
- name: Download and install terraform
|
||||||
become: "{{ ext_become }}"
|
when:
|
||||||
ansible.builtin.unarchive:
|
- not r_terraform_inst.stat.exists
|
||||||
dest: "{{ path.archive }}/terraform"
|
block:
|
||||||
src: "{{ d_tempdir.path }}/{{ terraform.file }}"
|
- name: Download terraform archive
|
||||||
remote_src: true
|
ansible.builtin.get_url:
|
||||||
|
dest: "{{ d_tempdir.path }}/{{ terraform.archive }}"
|
||||||
|
url: "{{ terraform.url }}/{{ terraform.archive }}"
|
||||||
|
mode: '0644'
|
||||||
|
decompress: false
|
||||||
|
|
||||||
|
- name: Ensure vault archive dir exists
|
||||||
|
become: "{{ ext_become }}"
|
||||||
|
ansible.builtin.file:
|
||||||
|
state: directory
|
||||||
|
path: "{{ terraform.path }}"
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Extract terraform archive
|
||||||
|
become: "{{ ext_become }}"
|
||||||
|
ansible.builtin.unarchive:
|
||||||
|
dest: "{{ terraform.path }}"
|
||||||
|
src: "{{ d_tempdir.path }}/{{ terraform.archive }}"
|
||||||
|
remote_src: true
|
||||||
|
|
||||||
|
- name: Link terraform executable
|
||||||
|
become: "{{ ext_become }}"
|
||||||
|
ansible.builtin.file:
|
||||||
|
state: link
|
||||||
|
src: "{{ terraform.path }}/terraform"
|
||||||
|
path: "{{ terraform.bin }}"
|
||||||
|
|||||||
37
tasks/archive/vault.yml
Normal file
37
tasks/archive/vault.yml
Normal 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 }}"
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
method: "{{ pkgconfig.terraform.method[ansible_os_family] | default(pkgconfig.terraform.method.default) }}"
|
method: "{{ pkgconfig.terraform.method[ansible_os_family] | default(pkgconfig.terraform.method.default) }}"
|
||||||
|
|
||||||
- name: Set terraform config
|
- name: Set terraform config
|
||||||
|
when:
|
||||||
|
- terraform.method == 'sys'
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
terraform:
|
terraform:
|
||||||
method: "{{ terraform.method }}"
|
method: "{{ terraform.method }}"
|
||||||
@@ -15,5 +17,7 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
terraform:
|
terraform:
|
||||||
method: "{{ terraform.method }}"
|
method: "{{ terraform.method }}"
|
||||||
|
archive: "terraform_{{ pkgconfig.terraform.version }}_{{ pkgconfig.terraform[sysmap] }}_{{ pkgconfig.terraform[archmap] }}.zip"
|
||||||
url: "{{ pkgconfig.terraform.archive.baseurl }}/{{ pkgconfig.terraform.version }}"
|
url: "{{ pkgconfig.terraform.archive.baseurl }}/{{ pkgconfig.terraform.version }}"
|
||||||
file: "terraform_{{ pkgconfig.terraform.version }}_linux_amd64.zip"
|
path: "{{ path.archive }}/terraform"
|
||||||
|
bin: "{{ path.bin }}/terraform"
|
||||||
|
|||||||
@@ -1,4 +1,23 @@
|
|||||||
- name: Set vault config
|
- name: Set vault install method
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
vault:
|
vault:
|
||||||
|
method: "{{ pkgconfig.vault.method[ansible_os_family] | default(pkgconfig.vault.method.default) }}"
|
||||||
|
|
||||||
|
- name: Set vault config {{ vault.method }}
|
||||||
|
when:
|
||||||
|
- vault.method == 'sys'
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
vault:
|
||||||
|
method: "{{ vault.method }}"
|
||||||
pkgs: "{{ pkgconfig.vault.pkgs[ansible_system] }}"
|
pkgs: "{{ pkgconfig.vault.pkgs[ansible_system] }}"
|
||||||
|
|
||||||
|
- name: Set vault config {{ vault.method }}
|
||||||
|
when:
|
||||||
|
- vault.method == 'archive'
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
vault:
|
||||||
|
method: "{{ vault.method }}"
|
||||||
|
archive: "vault_{{ pkgconfig.vault.version }}_{{ pkgconfig.vault[ansible_system] }}_{{ pkgconfig.vault[ansible_architecture] }}.zip"
|
||||||
|
url: "{{ pkgconfig.vault.baseurl }}/{{ pkgconfig.vault.version }}"
|
||||||
|
path: "{{ path.arhive }}/vault"
|
||||||
|
bin: "{{ path.bin }}/vault"
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
file: config/vault.yml
|
file: config/vault.yml
|
||||||
|
|
||||||
- name: Append vault
|
- name: Append vault
|
||||||
|
when:
|
||||||
|
- vault.method == 'sys'
|
||||||
block:
|
block:
|
||||||
- name: Append vault to pkg_tap
|
- name: Append vault to pkg_tap
|
||||||
when:
|
when:
|
||||||
@@ -28,6 +30,12 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
pkg_sys: "{{ pkg_sys + vault.pkgs }}"
|
pkg_sys: "{{ pkg_sys + vault.pkgs }}"
|
||||||
|
|
||||||
- name: Set vault_configured
|
- name: Append vault to pkg_archive
|
||||||
ansible.builtin.set_fact:
|
when:
|
||||||
vault_configured: true
|
- vault.method == 'archive'
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
pkg_archive: "{{ pkg_archive + ['vault'] }}"
|
||||||
|
|
||||||
|
- name: Set vault_configured
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
vault_configured: true
|
||||||
|
|||||||
@@ -2,11 +2,20 @@ terraform:
|
|||||||
version: 1.11.2
|
version: 1.11.2
|
||||||
archive:
|
archive:
|
||||||
baseurl: https://releases.hashicorp.com/terraform
|
baseurl: https://releases.hashicorp.com/terraform
|
||||||
method:
|
sysmap:
|
||||||
default: sys
|
Darwin: darwin
|
||||||
Alpine: archive
|
Linux: linux
|
||||||
|
archmap:
|
||||||
|
x86_64: amd64
|
||||||
|
arm64: arm64
|
||||||
|
aarch64: arm64
|
||||||
pkgs:
|
pkgs:
|
||||||
Linux:
|
Linux:
|
||||||
- terraform
|
- terraform
|
||||||
Darwin:
|
Darwin:
|
||||||
- hashicorp/tap/terraform
|
- hashicorp/tap/terraform
|
||||||
|
method:
|
||||||
|
default: sys
|
||||||
|
Alpine: archive
|
||||||
|
RedHat: sys
|
||||||
|
Darwin: sys
|
||||||
|
|||||||
@@ -1,6 +1,21 @@
|
|||||||
vault:
|
vault:
|
||||||
|
version: 1.19.0
|
||||||
|
archive:
|
||||||
|
baseurl: https://releases.hashicorp.com/vault
|
||||||
|
sysmap:
|
||||||
|
Darwin: darwin
|
||||||
|
Linux: linux
|
||||||
|
archmap:
|
||||||
|
x86_64: amd64
|
||||||
|
arm64: arm64
|
||||||
|
aarch64: arm64
|
||||||
pkgs:
|
pkgs:
|
||||||
Linux:
|
Linux:
|
||||||
- vault
|
- vault
|
||||||
Darwin:
|
Darwin:
|
||||||
- hashicorp/tap/vault
|
- hashicorp/tap/vault
|
||||||
|
method:
|
||||||
|
default: sys
|
||||||
|
Alpine: archive
|
||||||
|
RedHat: sys
|
||||||
|
Darwin: sys
|
||||||
|
|||||||
Reference in New Issue
Block a user