-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebsite.yml
54 lines (44 loc) · 1.22 KB
/
website.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
50
51
52
53
54
---
- name: deploy bootstrap-website
hosts: all
become: yes
become_user: root
tasks:
- name: update ec2 instance
yum:
name: "*"
state: latest
update_cache: yes
- name: install apache server
yum:
name: httpd
state: latest
- name: change directory to the html directory
shell: cd /var/www/html
- name: download web files from github
get_url:
url: https://github.com/mudasirhaji/website/raw/main/website.zip
dest: /var/www/html/
- name: unzip the zip folder
ansible.builtin.unarchive:
src: /var/www/html/website.zip
dest: /var/www/html
remote_src: yes
- name: copy webfiles from the website directory to the html directory
copy:
src: /var/www/html/website/
dest: /var/www/html
remote_src: yes
- name: remove the website directory
file:
path: /var/www/html/website
state: absent
- name: remove the website.zip folder
file:
path: /var/www/html/website.zip
state: absent
- name: start apache server, if not started
ansible.builtin.service:
enabled: yes
name: httpd
state: started