-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecrets.yml
47 lines (40 loc) · 1.28 KB
/
secrets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
- hosts: 127.0.0.1
connection: local
vars:
- passwd_generator_file: secrets_env.yml
- abs_passwd_generator_file: "{{ configdir }}/{{ passwd_generator_file }}"
tasks:
- name: "check if {{ configdir }} exists"
stat:
path: "{{ configdir }}"
register: confdir
when: not configdir == ""
- name: "create {{ configdir }} directory"
file:
path: "{{ configdir }}"
state: directory
mode: 0700
when:
- not confdir == ""
- confdir.stat.exists == False
- name: "check if {{ passwd_generator_file }} file exists"
stat:
path: "{{ abs_passwd_generator_file }}"
register: pass_file
- name: "create new {{ passwd_generator_file }} file"
command: "cp -p config/PLACEHOLDER/{{ passwd_generator_file }}.PLACEHOLDER {{ abs_passwd_generator_file }}"
when: pass_file.stat.exists == False
- name: "set permissions of {{ passwd_generator_file }}"
file:
path: "{{ abs_passwd_generator_file }}"
state: file
mode: 0600
- include_tasks: passwd_generator.yml
with_items:
- rsync_secret
- mysql_root_password
- postgresql_root_password
- oa4mp_server_db_pw
- oa4mp_server_keystore_pw
- democa_pass