-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrontend.yaml
More file actions
63 lines (46 loc) · 1.4 KB
/
frontend.yaml
File metadata and controls
63 lines (46 loc) · 1.4 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
- name: configure frotend service
hosts: frontend
become: yes
tasks:
- name: disable nginx
ansible.builtin.command: dnf module disable nginx -y
- name: enable nginx
ansible.builtin.command: dnf module disable nginx -y
- name: install nginx
ansible.builtin.dnf:
name: nginx
state: present
- name: start and enable service
ansible.builtin.service:
name: nginx
state: started
enabled: yes
- name: remove html directory
ansible.builtin.file:
path: /usr/share/nginx/html
state: absent
- name: create html directory
ansible.builtin.file:
path: /usr/share/nginx/html
state: directory
- name: download frontend code
ansible.builtin.get_url:
url: https://roboshop-artifacts.s3.amazonaws.com/frontend-v3.zip
dest: /tmp/frontend.zip
- name: unzip frontend code
ansible.builtin.unarchive:
src: /tmp/frontend.zip
dest: /usr/share/nginx/html
remote_src: yes
- name: remove default nginx conf
ansible.builtin.file:
path: /etc/nginx/nginx.conf
state: absent
- name: copy roboshop nginx conf
ansible.builtin.copy:
src: nginx.conf
dest: /etc/nginx/nginx.conf
- name: restart nginx
ansible.builtin.service:
name: nginx
state: restarted