-
Notifications
You must be signed in to change notification settings - Fork 13
/
server-env.yml
49 lines (42 loc) · 1.26 KB
/
server-env.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
48
49
---
- name: 'Update environment variables, master key and restart nginx'
hosts: web
user: "{{ deploy_user }}"
vars_files:
- vars/vars.yml
- vars/envs.yml
tasks:
- name: Create rbenv directory
file:
path: "/home/{{ deploy_user }}/{{ app_name }}"
state: directory
owner: "{{ deploy_user }}"
group: "{{ deploy_user }}"
- name: Update rbenv vars
template:
src: templates/rbenv.j2
dest: "/home/{{ deploy_user }}/{{ app_name }}/.rbenv-vars"
owner: "{{ deploy_user }}"
group: "{{ deploy_user }}"
- name: Update /etc/environment
template:
src: templates/env.j2
dest: "/etc/environment"
become: true
- name: Create shared config directory
file:
path: "/home/{{ deploy_user }}/{{ app_name }}/shared/config"
state: directory
owner: "{{ deploy_user }}"
group: "{{ deploy_user }}"
- name: Update master key
template:
src: templates/master.key.j2
dest: "/home/{{ deploy_user }}/{{ app_name }}/shared/config/master.key"
owner: "{{ deploy_user }}"
group: "{{ deploy_user }}"
- name: Restart nginx service
service:
name: nginx
state: restarted
become: true