-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.yml
96 lines (92 loc) · 2.54 KB
/
site.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
# ansible-playbook -i hosts site.yml
- hosts: all
gather_facts: yes
remote_user: pi
vars:
ivr_home: /opt/ivr
storage_uuid: "{{ansible_facts['devices']['sda']['partitions']['sda1']['uuid']}}"
storage_size: "{{ansible_facts['devices']['sda']['partitions']['sda1']['size']}}"
storage_vendor: "{{ansible_facts['devices']['sda']['vendor']}}"
storage_model: "{{ansible_facts['devices']['sda']['model']}}"
storage_mountpoint: "/mnt/ivr-data"
tasks:
- name: "Print Facts"
debug:
msg: "{{ansible_facts['devices']}}"
# - name: "Update apt repositories"
# apt:
# update_cache: yes
# become: true
# - name: "Upgrade local libraries"
# apt:
# upgrade: yes
# become: true
# - name: "Install tools and libraries"
# apt:
# name:
# - ntp
# - ffmpeg
# - gpsd
# - gpsd-clients
# - python3-pip
# - espeak-ng
# state: present
# become: true
# - name: "Install Python libraries"
# pip:
# name:
# - gps3
# - tzlocal
# # *******************************
# - name: "Configure /tmp/ivr to be mounted with tmpfs"
# ansible.posix.mount:
# src: tmpfs
# path: /tmp/ivr
# opts: defaults,size=1m
# state: mounted
# fstype: tmpfs
# become: true
# - name: "Create mount-point of data directory: {{storage_mountpoint}}"
# file:
# path: "{{storage_mountpoint}}"
# state: directory
# owner: root
# group: root
# mode: 0777
# become: true
# # *******************************
# - name: "Create the home directory and related directories"
# file:
# path: "{{item}}"
# state: directory
# owner: pi
# group: pi
# mode: 0755
# become: true
# loop:
# - "{{ivr_home}}"
# - "{{ivr_home}}/bin"
# - name: "Create symbolic links"
# file:
# path: "{{item.path}}"
# src: "{{item.src}}"
# state: link
# become: true
# loop:
# - { path: "{{ivr_home}}/tmp", src: "/tmp/ivr" }
# - { path: "{{ivr_home}}/data", src: "{{storage_mountpoint}}" }
# *******************************
- name: "Copy the executable files"
copy:
src: "{{item}}"
dest: "{{ivr_home}}/bin"
mode: 0755
with_fileglob:
- "files/bin/*.py"
- "files/bin/*.sh"
- "files/bin/*.wav"
# - name: "Register the script to cron to be started at boot"
# cron:
# name: "iVR auto start"
# special_time: reboot
# job: "{{ivr_home}}/bin/startup.sh > /home/pi/ivr-boot.log 2>&1"