-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
init.sls
73 lines (62 loc) · 2.77 KB
/
init.sls
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
#
# APT
#
{% set site_slug = salt['pillar.get']("netbox:site:slug") %}
{% if grains.os == 'Ubuntu' and grains.osmajorrelease >= 24 %}
/etc/apt/sources.list.d/ubuntu.sources:
{% else %}
/etc/apt/sources.list:
{% endif %}
file.managed:
- source:
- salt://apt/sources.list.{{ grains.os }}.{{ grains.oscodename }}.{{ site_slug }}
- salt://apt/sources.list.{{ grains.os }}.{{ grains.oscodename }}
/etc/apt/sources.list.d/repo_saltstack_com_apt_debian_9_amd64_latest.list:
file.absent
# as configured in sources.list so duplicate
/etc/apt/sources.list.d/hetzner-mirror.list:
file.absent
/etc/apt/sources.list.d/hetzner-security-updates.list:
file.absent
salt-repo-key:
file.managed:
- name: /usr/share/keyrings/salt-archive-keyring.gpg
{% if 'Ubuntu' in grains.lsb_distrib_id %}
- source: https://repo.saltproject.io/salt/py3/{{ grains.lsb_distrib_id | lower }}/{{ grains.osrelease }}/{{ grains.osarch }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg
{% elif 'Raspbian' in grains.lsb_distrib_id %}
- source: http://repo.saltproject.io/salt/py3/debian/{{ grains.osmajorrelease }}/{{ grains.osarch }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg
{% else %}
- source: http://repo.saltproject.io/salt/py3/{{ grains.lsb_distrib_id | lower }}/{{ grains.osmajorrelease }}/{{ grains.osarch }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg
{% endif %}
- skip_verify: True
salt-repo:
pkgrepo.managed:
{% if 'Ubuntu' in grains.lsb_distrib_id %}
- name: deb [arch={{ grains.osarch }} signed-by=/usr/share/keyrings/salt-archive-keyring.gpg] http://repo.saltproject.io/salt/py3/{{ grains.lsb_distrib_id | lower }}/{{ grains.osrelease }}/{{ grains.osarch }}/latest {{ grains.oscodename }} main
{% elif 'Raspbian' in grains.lsb_distrib_id %}
- name: deb [arch={{ grains.osarch }} signed-by=/usr/share/keyrings/salt-archive-keyring.gpg] http://repo.saltproject.io/salt/py3/debian/{{ grains.osmajorrelease }}/{{ grains.osarch }}/latest {{ grains.oscodename }} main
{% else %}
- name: deb [arch={{ grains.osarch }} signed-by=/usr/share/keyrings/salt-archive-keyring.gpg] http://repo.saltproject.io/salt/py3/{{ grains.lsb_distrib_id | lower }}/{{ grains.osmajorrelease }}/{{ grains.osarch }}/latest {{ grains.oscodename }} main # noqa: 204
{% endif %}
- file: /etc/apt/sources.list.d/saltstack.list
- clean_file: True
- require:
- file: salt-repo-key
/etc/cron.d/apt:
file.managed:
- source: salt://apt/update_apt.cron
apt-transport-https:
pkg.installed
python3-apt:
pkg.installed
# Purge old stuff
/etc/apt/sources.list.d/raspi.list:
file.absent
/etc/apt/sources.list.d/universe-factory.list:
file.absent
/etc/apt/preferences.d/libluajit:
file.managed:
- contents: |
Package: libluajit-5.1-2
Pin: origin deb.debian.org
Pin-Priority: 1001