-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraspberry-web.yaml
More file actions
89 lines (89 loc) · 2.61 KB
/
raspberry-web.yaml
File metadata and controls
89 lines (89 loc) · 2.61 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
--- # Ansible Playbook to configure a set of Raspberry PIs in a consistent and repeatable way
# Software installation and configuration for all Raspberry PI boxes
- hosts: raspberry
remote_user: "{{ user }}"
become: yes
vars:
src_dir: "{{ playbook_dir }}"
mode: u=rwx
vars_files:
- "{{ src_dir }}/conf/config.yml"
pre_tasks:
###############################################
##### Update package manager repositories #####
###############################################
- name: Update package manager repositories cache
apt:
update_cache: yes
######################################
##### Upgrade installed packages #####
######################################
- name: Upgrade installed packages
apt:
upgrade: dist
###########################
##### Openssl Section #####
###########################
- name: Install Openssl
apt:
name: openssl
state: present
# Software installation and configuration for Raspberry PI boxes acting as Reverse Proxies
- hosts: proxy_raspberry
remote_user: "{{ user }}"
become: yes
vars:
src_dir: "{{ playbook_dir }}"
mode: u=rwx
vars_files:
- "{{ src_dir }}/conf/config.yml"
- "{{ src_dir }}/conf/nginx.yml"
tasks:
#########################
##### NGINX Section #####
#########################
- name: Install Nginx
apt:
name: nginx
state: present
- name: Start Nginx server
service:
name: nginx
state: started
- name: Copy Nginx utility scripts to remote server
copy:
src: "{{ src_dir }}/scripts/nginx"
dest: "{{ remote_utilities_dir }}"
owner: "{{ user }}"
group: "{{ group }}"
mode: "{{ mode }}"
# Software installation and configuration for Raspberry PI boxes acting as Application Servers
- hosts: appserver_raspberry
remote_user: "{{ user }}"
become: yes
vars:
src_dir: "{{ playbook_dir }}"
mode: u=rwx
vars_files:
- "{{ src_dir }}/conf/config.yml"
- "{{ src_dir }}/conf/apache2.yml"
tasks:
################################
##### Apache2 HTTP Section #####
################################
- name: Install Apache2
apt:
name: apache2
state: present
- name: Start and enable Apache2
service:
name: apache2
state: started
enabled: yes
- name: Copy Apache2 utility scripts to remote server
copy:
src: "{{ src_dir }}/scripts/apache2"
dest: "{{ remote_utilities_dir }}"
owner: "{{ user }}"
group: "{{ group }}"
mode: "{{ mode }}"