Closed daks closed 8 years ago
Hi @daks, this is normal, the first part set_parameter will look up the parameter 'myhostname' in pillar, if it is found it will use that, otherwise it will fallback to a default value the second part, grains 'fqdn' which means it will use the fqdn grain of the minion as value.
Ok, so I need to check my setup because I don't have this behavior. Thanks for your quick answer.
My pillar file is
postfix:
config:
myhostname: host.example.org
and i still have my (vagrant vm) hostname in main.cf
does the pillar top.sls file load the pillar file?
something like:
/srv/pillar/top.sls
base:
'*':
- postfix
I thought it does, but I may have a problem there.
$ ls pillar/
postfix.sls top.sls
$ cat top.sls
base:
'*':
- postfix
I'm using Vagrant with masterless salt provisioning (but I use salt-call state.apply instead of reloading my vm). When I make a typo in top.sls, I got an error but I'm not sure it loads the postfix.sls pillar file.
@daks , the code looks good, could you do a
salt-call pillar.item postfix
It works and returns
local:
----------
postfix:
----------
config:
----------
myhostname:
host.example.org
weird.
@daks try
salt-call state.apply postfix.config
it works now. That means that my state doesn't include postfix.
$ ls salt/
top.sls postfix/
$ cat top.sls
base:
'*':
- postfix
and the postfix directory is the one from your formula.
When I call $ salt-call state.apply
in my VM, I see that it checks pkg.installed and service.running (2 states). With state.apply postfix.config
it runs 5 states.
Maybe this is the problem, I need to add postfix.config to my state?
yes, that's the solution, you can ditch the postfix state, in favor of postfix.config, please look at the sls files and there you see include: - postfix.
Yes, it works. Thank your very much for your help.
Hello,
I just discovered this formula which I try to use. I see in pillar.example there is a parameter called
I thought it will be used to manage the 'myhostname' Postfix parameter, which seems to not be the case: in https://github.com/saltstack-formulas/postfix-formula/blob/master/postfix/files/main.cf#L74 I see
It this normal, did I miss something? (I'm quite new to salt)
Thanks.