diff --git a/FORMULA b/FORMULA new file mode 100644 index 0000000000000000000000000000000000000000..f7ce8986dea4dfe3757540d299f7d4662f37982d --- /dev/null +++ b/FORMULA @@ -0,0 +1,7 @@ +name: hshbase +os: Debian, FreeBSD +os_family: Debian, FreeBSD +version: 201907 +release: 1 +summary: Formula that bundles some base configuration we want to enforce everywhere. +description: Not more to say as said in the summary already. \ No newline at end of file diff --git a/README.md b/README.md index 1f7a0c9b81d8ec8a56742300a24b8f2c394a06b0..478e9fd1d237514a3b0df9d377304dc1d74faa8e 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ Configures apt package manager on debian and ubuntu machines ### hshbase.time +**DEPRECATED** this formula only manages the time server up to debian 9 and ubuntu 16.04. +Starting with debian buster and ubuntu bionic beaver we use the systemd formula for network and timeserver configuration. + Install NTP, and sets timezone + timeserver ### hshbase.openvmtools @@ -27,10 +30,6 @@ Install the package open-vm-tools Install system locales and additional ones optionally -### hshbase.snmpd - -Install snmpd ready to be used with [Whats Up Gold](https://whatsup.fh-h.de/) - ### python-packages Install python modules for salt grains or modules - Currently: diff --git a/hshbase/apt/files/sources.list b/hshbase/apt/files/sources.list index 9e654b64da8df633419339f8866ee3085ca931fe..1eb0bb7580d779133f4e97b579ca331662732391 100644 --- a/hshbase/apt/files/sources.list +++ b/hshbase/apt/files/sources.list @@ -26,28 +26,26 @@ deb-src http://ftp.de.debian.org/debian {{ oscodename }}-lts main non-free {% elif os == 'Ubuntu' %} -{% if oscodename == 'trusty' %} -deb http://de.archive.ubuntu.com/ubuntu/ trusty main restricted -deb-src http://de.archive.ubuntu.com/ubuntu/ trusty main restricted -deb http://de.archive.ubuntu.com/ubuntu/ trusty-updates main restricted -deb-src http://de.archive.ubuntu.com/ubuntu/ trusty-updates main restricted -deb http://de.archive.ubuntu.com/ubuntu/ trusty universe -deb-src http://de.archive.ubuntu.com/ubuntu/ trusty universe -deb http://de.archive.ubuntu.com/ubuntu/ trusty-updates universe -deb-src http://de.archive.ubuntu.com/ubuntu/ trusty-updates universe -deb http://de.archive.ubuntu.com/ubuntu/ trusty multiverse -deb-src http://de.archive.ubuntu.com/ubuntu/ trusty multiverse -deb http://de.archive.ubuntu.com/ubuntu/ trusty-updates multiverse -deb-src http://de.archive.ubuntu.com/ubuntu/ trusty-updates multiverse -deb http://de.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse -deb-src http://de.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse -deb http://security.ubuntu.com/ubuntu trusty-security main restricted -deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted -deb http://security.ubuntu.com/ubuntu trusty-security universe -deb-src http://security.ubuntu.com/ubuntu trusty-security universe -deb http://security.ubuntu.com/ubuntu trusty-security multiverse -deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse -{% endif %} +deb http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }} main restricted +deb-src http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }} main restricted +deb http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }}-updates main restricted +deb-src http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }}-updates main restricted +deb http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }} universe +deb-src http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }} universe +deb http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }}-updates universe +deb-src http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }}-updates universe +deb http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }} multiverse +deb-src http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }} multiverse +deb http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }}-updates multiverse +deb-src http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }}-updates multiverse +deb http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }}-backports main restricted universe multiverse +deb-src http://de.archive.ubuntu.com/ubuntu/ {{ oscodename }}-backports main restricted universe multiverse +deb http://security.ubuntu.com/ubuntu {{ oscodename }}-security main restricted +deb-src http://security.ubuntu.com/ubuntu {{ oscodename }}-security main restricted +deb http://security.ubuntu.com/ubuntu {{ oscodename }}-security universe +deb-src http://security.ubuntu.com/ubuntu {{ oscodename }}-security universe +deb http://security.ubuntu.com/ubuntu {{ oscodename }}-security multiverse +deb-src http://security.ubuntu.com/ubuntu {{ oscodename }}-security multiverse {% else %} # Something went wrong - apt-sources not ready BUT CONFIGURED (init.sls) for this! diff --git a/hshbase/apt/init.sls b/hshbase/apt/init.sls index d1084bfebf2e94a1742fc32818bd727290adecb4..76189d626e29710d09b35c6692a89bf835ce63ac 100644 --- a/hshbase/apt/init.sls +++ b/hshbase/apt/init.sls @@ -6,8 +6,8 @@ include: - .pkgs # control /apt/sources.list and apt.sources.list.d on ubuntu and debian -{% if grains['os'] == 'Debian' and grains['oscodename'] in ['squeeze', 'wheezy', 'jessie', 'stretch'] - or grains['os'] == 'Ubuntu' and grains['oscodename'] in ['trusty'] %} +{% if grains['os'] == 'Debian' and grains['oscodename'] in ['squeeze', 'wheezy', 'jessie', 'stretch', 'buster'] + or grains['os'] == 'Ubuntu' and grains['oscodename'] in ['trusty', 'xenial', 'bionic'] %} hsh_apt_sources_list: file.managed: - name: /etc/apt/sources.list diff --git a/hshbase/defaults.yaml b/hshbase/defaults.yaml index 54f10046e84b067a0320211c9b7b9e1c4d10df41..485e33cf25f39afa7c407811b88d0015ddea8350 100644 --- a/hshbase/defaults.yaml +++ b/hshbase/defaults.yaml @@ -11,4 +11,3 @@ hshbase: system: en_US.UTF-8 present: - de_DE.UTF-8 - snmpd: True diff --git a/hshbase/openvmtools.sls b/hshbase/openvmtools.sls index 1e0fb768a83d504b40758b2b0f32fb74f71b05e8..4c01a79924e25a2007c0422192d3db3c727b5578 100644 --- a/hshbase/openvmtools.sls +++ b/hshbase/openvmtools.sls @@ -4,10 +4,19 @@ # For Debian/Ubuntu >6, wheezy packages have different names. # Also, wheezy packages don't work, so they still get vmware stuff! -{% if grains['os'] in ['Debian', 'Ubuntu'] and grains['oscodename'] not in ['squeeze', 'wheezy'] %} +# this block can be removed when everything is > debian 9 +{% if grains['os'] in ['Debian', 'Ubuntu'] and grains['oscodename'] not in ['squeeze', 'wheezy', 'stretch', 'buster', 'bionic'] %} hsh_openvmtools: pkg.installed: - pkgs: [open-vm-tools, open-vm-tools-dkms] + - refresh: True + +# Debian buster does not include the dkms package anymore +{% elif grains['os'] in ['Debian', 'Ubuntu'] and grains['oscodename'] in ['buster', 'bionic'] %} +hsh_openvmtools: + pkg.installed: + - pkgs: [open-vm-tools] + - refresh: True {% elif grains['os'] == 'FreeBSD' %} hsh_openvmtools: diff --git a/hshbase/packages.sls b/hshbase/packages.sls index fdefee6485133353c1d4c486f938b74740b4f8a0..ff22a49b40c2434091c2c854b3e241a7425e5e0c 100644 --- a/hshbase/packages.sls +++ b/hshbase/packages.sls @@ -1,5 +1,5 @@ # Always install these packages -{% if grains['os'] == 'Debian' or grains['os'] == 'Ubuntu' %} +{% if grains['os'] in ['Debian', 'Ubuntu'] %} hsh_common_packages_salt: pkg.installed: - pkgs: @@ -9,6 +9,7 @@ hsh_common_packages_salt: - etckeeper - lsof - traceroute + - vim {% elif grains['os'] == 'FreeBSD' %} hsh_common_packages_salt: diff --git a/hshbase/time/init.sls b/hshbase/time/init.sls index 65b0df00134b6a9e67a62ced2728bca720ae8338..2d32cb53cf0fd3a581b54be1ad21bb9c30881cba 100644 --- a/hshbase/time/init.sls +++ b/hshbase/time/init.sls @@ -1,8 +1,10 @@ {% from "hshbase/map.jinja" import hshbase with context %} -{% if grains['os'] in ('Debian', 'Ubuntu') %} +{# We stick with ntpd for debian boxes before buster and for ubuntu boxes before bionic #} +{% if (grains['os'] == 'Debian' and grains['osmajorrelease'] < 10) or (grains['os'] == 'Ubuntu' and grains['osmajorrelease'] < 18) %} ntp: - pkg.installed + pkg.installed: + - refresh: True /etc/ntp.conf: file.managed: @@ -13,7 +15,6 @@ ntp: - require: - pkg: ntp -{% if grains['os'] == 'Debian' and grains['oscodename'] != 'jessie' %} hsh_ntp_service_running: service.running: - name: ntp @@ -25,17 +26,30 @@ hsh_ntp_service_running: - file: /etc/ntp.conf - pkg: ntp -{% else %} -{# We are not waiting for ntp here! Read this:\n* https://github.com/systemd/systemd/issues/937\n* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=635752 #} +{# The new boxes ensure the old stuff is away and the rest is configured in the interfaces section #} +{% elif (grains['os'] == 'Debian' and grains['osmajorrelease'] >= 10) or grains['os'] == 'Ubuntu' and grains['osmajorrelease'] >= 18 %} -{% endif %} +ntp: + pkg.purged -hsh_server_timezone: - timezone.system: - - name: {{ hshbase.time.zone }} +/etc/ntp.conf: + file.absent: + - require: + - pkg: ntp + +hsh_ntp_service_not_running: + service.disabled: + - name: ntp + - require: + - file: /etc/ntp.conf + - pkg: ntp {% elif grains['os'] == 'FreeBSD' %} {# TODO: Manage /etc/ntp.conf file. #} {% endif %} + +hsh_server_timezone: + timezone.system: + - name: {{ hshbase.time.zone }}