I'm trying to get started with salt after lots of reading of
docs. I'm clearly missing something. The goal at the moment is
to get a minimal masterless example running to convince myself
that I can do anything. I'm doing this on a vagrant instance.
Once I have this working, I'll convince myself I can deploy to a
real (linode vps) host. Once that's working, the plan is to start
using a salt master. One thing at a time. I'm moving our infra
from puppet, so the plan is to move responsibilities one at a time
from puppet to salt.
Let's start by creating a file.
In both /etc/salt/{master,minion}, I've added these lines:
file_roots:
base:
- /srv/salt
And I have created these files:
ubuntu@tyne1:~$ find /srv
/srv
/srv/salt
/srv/salt/jeff
/srv/salt/jeff/jeff
/srv/salt/jeff/init.cls
/srv/salt/top.cls
ubuntu@tyne1:~$
== top.cls ==
base:
'*':
- jeff
== jeff/init.cls ==
/tmp/jeff:
file.managed:
- source: salt://jeff/jeff
- user: ubuntu
- group: ubuntu
- mode: 400
== jeff/jeff ==
Hello, world!
So now I'd like to get salt to create that little file in /tmp/.
ubuntu@tyne1:~$ sudo salt-call --local
state.apply -l debug
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Using cached minion ID from /etc/salt/minion_id:
xxxxx
[DEBUG ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive
data may be logged.
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Determining pillar cache
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] LazyLoaded state.apply
[DEBUG ] LazyLoaded grains.get
[DEBUG ] LazyLoaded saltutil.is_running
[DEBUG ] LazyLoaded roots.envs
[DEBUG ] Could not LazyLoad roots.init: 'roots.init' is not
available.
[DEBUG ] Updating roots fileserver cache
[INFO ] Loading fresh modules for state activity
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] Could not find file 'salt://top.sls' in saltenv
'base'
[DEBUG ] No contents loaded for env: base
[DEBUG ] No contents found in top file. If this is not
expected, verify that the 'file_roots' specified in
'etc/master' are accessible. The 'file_roots' configuration
is: {'base': ['/srv/salt']}
[DEBUG ] LazyLoaded config.option
[DEBUG ] LazyLoaded highstate.output
local:
----------
ID: states
Function: no.None
Result: False
Comment: No Top file or master_tops data matches found.
Changes:
Summary for local
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
Total run time: 0.000 ms
ubuntu@tyne1:~$
Any pointers to what I'm missing or not understanding?
-- Jeff Abrahamson +33 6 24 40 01 57 +44 7920 594 255 http://p27.eu/jeff/
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/4785692a-5363-2cfa-55b0-e8be345e6924%40p27.eu.
For more options, visit https://groups.google.com/d/optout.