saltstack-formulas / ntp-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
23 stars 158 forks source link

nptd isn't started and enabled #11

Closed MarcoWeiss closed 10 years ago

MarcoWeiss commented 10 years ago

Hi all,

i'm new to salt and GitHub today but i have a first request. On the ntp-formular i can't see a functionality that starts the ntpd and enabling it as service.

Can you add something like the service section i added below in the init.sls ?

{% from "ntp/map.jinja" import ntp with context %}

ntp:
  pkg:
    - installed
    - name: {{ ntp.client }}

{% set ntp_conf_src = salt['pillar.get']('ntp:ntp_conf') -%}

{% if ntp_conf_src %}
ntp_conf:
  file:
    - managed
    - name: {{ ntp.ntp_conf }}
    - template: jinja
    - source: {{ ntp_conf_src }}
    - require:
      - pkg: ntp

  service:
    - name: {{ ntp.service }}
    - running
    - enable: True
    - watch:
      - file: {{ ntp.ntp_conf }}
    - require:
      - pkg: ntp
{% endif %}
whiteinge commented 10 years ago

Have you seen this file? It appears to be what you're looking for.

MarcoWeiss commented 10 years ago

Hi whiteinge, thanks a lot ;) The bug was me ;)

whiteinge commented 10 years ago

Hehe :) Glad it's working for you.