added ansible task to open encrypted drive
This commit is contained in:
parent
baa99e9e5b
commit
ae715c20dc
4 changed files with 33 additions and 3 deletions
|
@ -1,6 +1,9 @@
|
|||
---
|
||||
|
||||
encrypted_drive_password: "{{ vault_encrypted_drive_password }}"
|
||||
encrypted_drive:
|
||||
name: "vault"
|
||||
location: "/vault"
|
||||
password: "{{ vault_encrypted_drive_password }}"
|
||||
|
||||
mysql_root_password: "{{ vault_mysql_root_password }}"
|
||||
adrien_serenity_password: "{{ vault_adrien_serenity_password }}"
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
---
|
||||
|
||||
- name: Restart MySQL
|
||||
service:
|
||||
name: mysql
|
||||
state: restarted
|
||||
become: yes
|
||||
|
||||
- name: Restart PostgreSQL
|
||||
service:
|
||||
name: postgresql
|
||||
state: restarted
|
||||
become: yes
|
||||
|
||||
- name: Restart Docker
|
||||
service:
|
||||
name: docker
|
||||
state: restarted
|
||||
become: yes
|
||||
tags: docker
|
||||
become: yes
|
12
deployer/roles/host/tasks/encrypted_drive.yml
Normal file
12
deployer/roles/host/tasks/encrypted_drive.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
- name: "Open encrypted drive"
|
||||
commane:
|
||||
cmd: "/sbin/mount_vault"
|
||||
stdin: "{{ encrypted_drive.password }}" # The drive's password
|
||||
creates: "{{ www_path }}" # Will not run if path already exists
|
||||
stdin_add_newline: yes
|
||||
become: true
|
||||
notify:
|
||||
- Restart MySQL
|
||||
- Restart PostgreSQL
|
||||
- Restart Docker
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
# TODO: Ensure anacron is installed
|
||||
|
||||
- name: Open encrypted drive
|
||||
include_tasks: encrypted_drive.yml
|
||||
tags: always
|
||||
|
||||
- name: Configure logrotate
|
||||
include_tasks: logrotate.yml
|
||||
tags: logrotate
|
||||
|
|
Loading…
Reference in a new issue