Skip to content
Snippets Groups Projects
Select Git revision
  • c7496988d146c4f24e1734c69c98d2b8f488e3d9
  • master default protected
  • typos
  • development protected
  • ReadMe_Typos
  • example
  • feat/autocomplete-vscode
  • v3.3
  • v3.2
  • v3.1
  • v3.0
  • v2.2
  • v2.1
  • v2.0
  • old-example
  • v1.5
  • v1.4
  • v1.3
  • v1.0
  • v1.1
  • v1.2
21 results

README.md

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 }}