-
Notifications
You must be signed in to change notification settings - Fork 0
/
pi.yml
123 lines (106 loc) · 2.13 KB
/
pi.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
#
# note: .ini file holds IP of Pi to ssh and configure
#
- name: Pi all things
hosts: my_devices
tasks:
#
# sensor part
#
- name: Git
apt:
name: git
state: present
become: yes
- name: Code
git:
repo: 'https://github.com/paulvha/sds011'
dest: /home/pi/sensor
- name: Build
make:
chdir: /home/pi/sensor/src
become: yes
#
# recorder part
#
- name: Ruby
apt:
name: ruby
state: present
become: yes
- name:
copy:
src: ./do_record_data.rb
dest: /home/pi/
mode: '0755'
- name: Data dir
file:
path: "/home/pi/air_data"
state: directory
mode: '0755'
owner: pi
group: pi
- name: Record Service file
template:
src: air.service
dest: /etc/systemd/system/air.service
mode: '0644'
become: yes
- name: (ignore)
command: systemctl daemon-reload
become: yes
- name: Record Service enable
systemd:
name: air
enabled: yes
become: yes
- name: (ignore)
systemd:
name: air
state: stopped
become: yes
ignore_errors: true
- name: Record Service start
systemd:
name: air
state: started
become: yes
#
# storing part
#
- name:
copy:
src: ./do_store_data.sh
dest: /home/pi/
mode: '0755'
- name: AWS cli
apt:
name: awscli
state: present
become: yes
- name: Store Service file
template:
src: store.service
dest: /etc/systemd/system/store.service
mode: '0644'
become: yes
- name: (ignore)
command: systemctl daemon-reload
become: yes
- name: Store Service enable
systemd:
name: store
enabled: yes
become: yes
- name: (ignore)
systemd:
name: store
state: stopped
become: yes
ignore_errors: true
- name: Store Service start
systemd:
name: store
state: started
become: yes