1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
8 - name: copy apt sources.list
11 dest: "/etc/apt/sources.list"
16 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/apt-sources.list"
17 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/apt-sources.list"
18 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/apt-sources.list"
19 - "default/apt-sources.list"
22 - name: copy apt package-pinning
25 dest: "/etc/apt/preferences.d/pinning.pref"
30 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/apt-pinning.pref"
31 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/apt-pinning.pref"
32 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/apt-pinning.pref"
33 - "default/apt-pinning.pref"
36 - name: copy apt kernel autoremove settings
39 dest: "/etc/apt/apt.conf.d/01autoremove"
44 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/apt.conf.d/01autoremove"
45 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/01autoremove"
46 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/01autoremove"
47 - "default/apt.conf.d/01autoremove"
50 - name: copy additional apt settings
53 dest: "/etc/apt/apt.conf.d/90somecustom"
58 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/apt.conf.d/90somecustom"
59 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/90somecustom"
60 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/90somecustom"
61 - "default/apt.conf.d/90somecustom"
64 - name: copy additional dpkg settings
67 dest: "/etc/dpkg/dpkg.cfg.d/90somecustom"
72 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/dpkg.cfg.d-90somecustom"
73 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/dpkg.cfg.d-90somecustom"
74 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/dpkg.cfg.d-90somecustom"
75 - "default/dpkg.cfg.d-90somecustom"
78 - name: copy ucf settings
86 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/ucf.conf"
87 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/ucf.conf"
88 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/ucf.conf"
92 - name: copy ucf bin to /usr/bin/ucf
100 - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/ucf.bin"
101 - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/ucf.bin"
102 - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/ucf.bin"
106 - name: disable and stop apt-daily.timer
108 name: apt-daily.timer
114 - name: disable and stop apt-daily-upgrade.timer
116 name: apt-daily-upgrade.timer
122 - name: update repository cache if older than {{apt_cache_valid_time}} sec
125 cache_valid_time: "{{apt_cache_valid_time}}"
130 - name: install apt helper packages
132 pkg: "{{apt_helper_packages}}"
136 ignore_errors: "{{ignore_online_errors | bool}}"
140 - name: update repository cache once more
148 # Use new configs. always. otherwise things like distupgrade can break.
149 - name: upgrade packages
152 install_recommends: no
154 dpkg_options: 'force-confnew,force-confmiss'
156 ignore_errors: "{{ignore_online_errors | bool}}"
159 - name: remove dependencies that are no longer required
164 ignore_errors: "{{ignore_online_errors | bool}}"
165 when: apt_cleanup | bool
168 - name: remove useless packages from the download cache
172 ignore_errors: "{{ignore_online_errors | bool}}"
173 when: apt_cleanup | bool
176 - name: install additional packages
178 pkg: "{{ apt_additional_pkg + apt_additional_pkg_extra }}"
182 ignore_errors: "{{ignore_online_errors | bool}}"
185 - name: install additional bare metal packages
187 pkg: "{{ apt_additional_pkg_bare_metal }}"
190 when: is_bare_metal | bool
192 ignore_errors: "{{ignore_online_errors | bool}}"
195 # hacky, but sufficient for now: enablestart some installed services
196 - name: enable and start plocate-updatedb.timer
197 include_role: name="base/systemd/enable-and-start"
199 service_name: plocate-updatedb.timer
201 - name: enable and start lm-sensors.service
202 include_role: name="base/systemd/enable-and-start"
204 service_name: lm-sensors.service
205 when: is_bare_metal | bool
207 - name: enable and start smartmontools.service
208 include_role: name="base/systemd/enable-and-start"
210 service_name: smartmontools.service
211 when: is_bare_metal | bool