-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
146 lines (131 loc) · 3.51 KB
/
playbook.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
- hosts: all
vars:
ansible_python_interpreter: /usr/bin/python
setup_dac: true
target_user: "{{ ansible_user | default('pi') }}"
tasks:
- name: Update APT package cache
become: true
apt: update_cache=yes cache_valid_time=600
tags:
- os
- name: Upgrade APT to the latest packages
become: true
apt: upgrade=dist autoremove=yes
register: apt_result
tags:
- os
- name: Install packages
become: true
apt:
name: ["p7zip-full", "cpufrequtils", "vim"]
state: present
tags:
- os
- name: Elevate account privileges
become: true
blockinfile:
path: /etc/security/limits.conf
block: |
@{{ target_user }} - rtprio 90
@{{ target_user }} - nice -10
@{{ target_user }} - memlock 512000
backup: yes
tags:
- os
- name: include dac setup if enabled
include_tasks: dac.yml
when: setup_dac
tags:
- dac
- name: Cleanup exist installation
file:
path: "/home/{{ target_user }}/Pianoteq {item}"
state: absent
with_items:
- '7 STAGE'
- '7'
- '8 STAGE'
- '8'
tags:
- pianoteq
- install
- name: Find Pianoteq on host
set_fact:
pianoteq_app: "{{ item }}"
with_fileglob: ["library/pianoteq*.7z"]
tags:
- pianoteq
- install
- name: Copy Pianoteq
copy:
src: "{{ pianoteq_app }}"
dest: "/home/{{ target_user }}/Downloads"
tags:
- pianoteq
- install
- name: Extract Pianoteq
command: 7za x /home/{{ target_user }}/Downloads/{{ pianoteq_app | basename }}
args:
chdir: "/home/{{ target_user }}"
tags:
- pianoteq
- install
- name: Copy Pianoteq execute shell
copy:
src: ./library/Pianoteq.sh
dest: "/home/{{ target_user }}/Pianoteq 8/arm-64bit"
mode: 0755
owner: "{{ target_user }}"
group: "{{ target_user }}"
tags:
- pianoteq
- config
- name: Copy Pianoteq icon
copy:
src: ./library/pianoteq_icon_128.png
dest: "/home/{{ target_user }}/Pianoteq 8/arm-64bit"
mode: 0644
owner: "{{ target_user }}"
group: "{{ target_user }}"
tags:
- pianoteq
- config
- name: Generate Pianoteq desktop shortcut
template:
src: ./library/Pianoteq.desktop.j2
dest: "/home/{{ target_user }}/Desktop/Pianoteq.desktop"
mode: 0744
owner: "{{ target_user }}"
group: "{{ target_user }}"
tags:
- pianoteq
- config
- name: Create autostart link
become: true
file:
src: "/home/{{ target_user }}/Desktop/Pianoteq.desktop"
dest: "/etc/xdg/autostart/Pianoteq.desktop"
state: link
tags:
- pianoteq
- config
# - name: Change desktop font color
# lineinfile:
# path: /home/pi/.config/pcmanfm/LXDE-pi/desktop-items-0.conf
# regexp: 'desktop_fg'
# line: 'desktop_fg=#000000000000'
# tags:
# - config
- name: Reboot host and wait for it to restart
become: true
reboot:
msg: "Reboot initiated by Ansible"
connect_timeout: 5
reboot_timeout: 600
pre_reboot_delay: 0
post_reboot_delay: 1
test_command: whoami
tags:
- reboot