saltstack-formulas / sysstat-formula

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

Fails to set options correctly on Ubuntu #6

Closed rokka-n closed 9 years ago

rokka-n commented 9 years ago

Well, it might be Ubuntu's own way of doing things, but they require "true" in /etc/default/sysstat

config.sls will set it as "True", which is a huge mistake from Ubuntu's prospective. https://github.com/saltstack-formulas/sysstat-formula/blob/master/sysstat/config.sls

Is there a way to satisfy Ubuntu's requirements to use only lowercase in the config options of /etc/default/sysstat?

whiteinge commented 9 years ago

The default in config.sls is a string but the Pillar example is a boolean. The Pillar example should be changed to be a string instead.

whiteinge commented 9 years ago

Thanks, Nitin!

On Sat, Nov 8, 2014, 11:23 Nitin Madhok notifications@github.com wrote:

Closed #6 https://github.com/saltstack-formulas/sysstat-formula/issues/6 via f876a97 https://github.com/saltstack-formulas/sysstat-formula/commit/f876a977d62f4c14bd8788e4477382341df90532 .

— Reply to this email directly or view it on GitHub https://github.com/saltstack-formulas/sysstat-formula/issues/6#event-190357190 .

rokka-n commented 9 years ago

Thanks!

I think one additional change in config.sls is required so state from pillar correctly set as string as well.

sysstat-config:
  file.managed:
    - name: {{ sysstat.config }}
    - source: salt://sysstat/sysstat.default
    - mode: 644
    - user: root
    - group: root
    - template: jinja
    - defaults:
        #enabled: "true"
        enabled: "{{ enabled }}"```
nmadhok commented 9 years ago

@whiteinge No problem! @rokka-n Did you try the formula with the changes i made?

rokka-n commented 9 years ago

Yes, with quotes it works correctly.

nmadhok commented 9 years ago

@rokka-n I meant does the formula work in it's present state or enabled: {{ enabled }} needs to be changed to enabled: "{{ enabled }}"

rokka-n commented 9 years ago

It has to be changed to have quotes, otherwise you'll get boolean True

nmadhok commented 9 years ago

@rokka-n Done! Can you please test again?