From f92c43c7e3e7540a72092a2870c900aff9a9f40b Mon Sep 17 00:00:00 2001 From: Thedro Neely Date: Sat, 14 Mar 2020 04:01:46 -0400 Subject: roles/vault/main: Move variables to variables file --- roles/vault/main.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'roles/vault') diff --git a/roles/vault/main.yml b/roles/vault/main.yml index 31649fc..cfe48ac 100644 --- a/roles/vault/main.yml +++ b/roles/vault/main.yml @@ -1,26 +1,25 @@ --- -# Target: alpine3.10 +# Target: alpine3.11 - name: Install Vault hosts: vault - vars: - username: vault - deploy_path: "/opt/{{ username }}" - version: 1.3.2 + + vars_files: + - ../variables.yml tasks: - name: Ensuring group exists group: - name: "{{ username }}" + name: "{{ vault_user }}" state: present - name: Creating user and making home directory user: system: yes state: present - name: "{{ username }}" - groups: "{{ username }}" - home: "{{ deploy_path }}" + name: "{{ vault_user }}" + groups: "{{ vault_user }}" + home: "{{ vault_home }}" - name: Installing the required dependencies apk: @@ -36,29 +35,29 @@ - name: Downloading and extracting application unarchive: - src: "https://releases.hashicorp.com/vault/{{ version }}/vault_{{ version }}_linux_amd64.zip" - dest: "{{ deploy_path }}" + src: "https://releases.hashicorp.com/vault/{{ vault_version }}/vault_{{ vault_version }}_linux_amd64.zip" + dest: "{{ vault_home }}" remote_src: yes - name: Creating data folder file: - path: "{{ deploy_path }}/data" + path: "{{ vault_home }}/data" state: directory mode: '0755' - name: Copying config file copy: src: config.json - dest: "{{ deploy_path }}" + dest: "{{ vault_home }}" mode: '0644' register: vaultConfig become: true - become_user: "{{ username }}" + become_user: "{{ vault_user }}" - name: Allowing application to call mlock capabilities: - path: "{{ deploy_path }}/vault" + path: "{{ vault_home }}/vault" capability: cap_ipc_lock=+ep state: present -- cgit v1.2.3