Newer
Older
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
#!/usr/bin/env ansible-playbook
---
- name: MIGRATE TO DEBIAN 10
hosts: all
tasks:
- name: check / space
shell:
cmd: '[ $(df --output="avail" / | tail -n 1) -gt 4000000 ]'
- name: check /boot space
shell:
cmd: '[ $(df --output="avail" /boot | tail -n 1) -gt 300000 ]'
- name: dist-upgrade current ubuntu
apt:
force_apt_get: true
install_recommends: false
update_cache: true
dpkg_options: force-confnew
upgrade: dist
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
- name: autoremove current ubuntu
apt:
force_apt_get: true
install_recommends: false
autoclean: true
autoremove: true
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
- name: list ubicast packages
shell:
cmd: |
rm -f /root/ubicast-installed;
for pkg in 'ubicast-mediaserver' 'ubicast-mediaserver-runtime' 'ubicast-monitor' 'ubicast-monitor-runtime' 'ubicast-skyreach' 'ubicast-skyreach-runtime' 'celerity-server' 'celerity-workers'; do
dpkg -s "$pkg" >/dev/null 2>&1 && echo -n "$pkg " | tee -a '/root/ubicast-installed';
echo '';
done
- name: dump mediaserver database
shell:
cmd: /usr/bin/mscontroller.py dump
- name: dump skyreach database
shell:
cmd: /home/skyreach/htdocs/skyreach_site/scripts/control.sh dump
- name: stop services
loop:
- nginx
- msmonitor
- mediaserver
- skyreach
systemd:
name: "{{ item }}"
state: stopped
- name: add debian keys
loop:
- https://ftp-master.debian.org/keys/archive-key-10.asc
- https://ftp-master.debian.org/keys/archive-key-10-security.asc
apt_key:
url: "{{ item }}"
- name: disable skyreach repository
shell:
cmd: mv -f /etc/apt/sources.list.d/ubicast.list /etc/apt/sources.list.d/ubicast.list.migrate
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
147
148
- name: update sources list
copy:
dest: /etc/apt/sources.list
content: |
deb http://ftp.debian.org/debian buster main contrib non-free
deb http://ftp.debian.org/debian buster-updates main contrib non-free
deb http://security.debian.org buster/updates main contrib non-free
- name: install debian keyring
apt:
force_apt_get: true
install_recommends: false
update_cache: true
name: debian-archive-keyring
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
- name: upgrade to debian
apt:
force_apt_get: true
install_recommends: false
update_cache: true
dpkg_options: force-confnew
upgrade: dist
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
- name: autoremove debian
apt:
force_apt_get: true
install_recommends: false
autoclean: true
autoremove: true
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
- name: install apt-show-version
apt:
force_apt_get: true
install_recommends: false
name: apt-show-version
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
- name: install debian version of packages
shell:
cmd: "apt-get install $(apt-show-versions | grep -P 'newer than version in archive' | awk -F: '{print $1\"/buster\"}')"
- name: upgrade
apt:
force_apt_get: true
install_recommends: false
update_cache: true
dpkg_options: force-confnew
upgrade: dist
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
- name: autoremove
apt:
force_apt_get: true
install_recommends: false
autoclean: true
autoremove: true
register: apt_status
retries: 60
until: apt_status is success or ('Failed to lock apt for exclusive operation' not in apt_status.msg and '/var/lib/dpkg/lock' not in apt_status.msg)
...