summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2020-03-14 04:01:46 -0400
committerThedro Neely <thedroneely@gmail.com>2020-03-14 04:01:46 -0400
commitf92c43c7e3e7540a72092a2870c900aff9a9f40b (patch)
tree4eb4a0c0f572fb3436f36a9f202aae673f850d47
parent7b1e554263201d509a8821e2834d6bfca3dad315 (diff)
downloadplaybooks-f92c43c7e3e7540a72092a2870c900aff9a9f40b.tar.gz
playbooks-f92c43c7e3e7540a72092a2870c900aff9a9f40b.tar.bz2
playbooks-f92c43c7e3e7540a72092a2870c900aff9a9f40b.zip
roles/vault/main: Move variables to variables file
-rw-r--r--roles/variables.yml4
-rw-r--r--roles/vault/main.yml29
2 files changed, 18 insertions, 15 deletions
diff --git a/roles/variables.yml b/roles/variables.yml
index 95d2394..48b6f96 100644
--- a/roles/variables.yml
+++ b/roles/variables.yml
@@ -10,4 +10,8 @@ gitea_version: 1.11.3
gitea_url: "https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64"
gitea_checksum: "https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-amd64.sha256"
+vault_user: vault
+vault_home: "/opt/{{ vault_user }}"
+vault_version: 1.3.2
+
docker_registry_version: 2.7.1
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