Skip to content
Snippets Groups Projects
Select Git revision
  • 094b149262ab7355be37832c337f4e76150e525d
  • master default
2 results

defaults.yaml

Blame
  • init.sls 1.28 KiB
    {% from "hshbase/map.jinja" import hshbase with context %}
    
    {# 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:
        - refresh: True
    
    /etc/ntp.conf:
      file.managed:
        - source: salt://hshbase/time/files/ntp.conf
        - template: jinja
        - context:
          hshbase: hshbase
        - require:
          - pkg: ntp
    
    hsh_ntp_service_running:
      service.running:
        - name: ntp
        - reload: True
        - enable: True
        - watch:
          - file: /etc/ntp.conf
        - require:
          - file: /etc/ntp.conf
          - pkg: ntp
    
    {# 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 %}
    
    ntp:
      pkg.purged
    
    /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 }}