0
votes

I want to install with salt lxd containers, and I got only errors. I'm beginner with salt. I've cloned lxd-formula from GitHub, and I put folders under /srv/salt:

/srv/salt/lxd
/srv/salt/_modules
/srv/salt/_states

and I modify file_roots like this:

file_roots:
  base:
   - /srv/salt
   - /srv/formula/lxd-formula

and I try to install a container with this config test/test4.sls:

lxd:
 containers:
  local:
   ubuntu-xenial:
   running: True
   source: xenial/amd64

and used this command:

salt '*hv-04*' state.sls test.test4

and I've got this error:

State 'lxd' in SLS 'test.test3' is not formed as a list
1

1 Answers

1
votes

I believe you misunderstood how the configuration and utilization of formulas work.

You are not creating a state, you are just configuring it. All you did in test/test4.sls should be in the pillar. Read more about configuring formulas using pillar to understand better how it works

After configuring it, just run the state for container creation which, according to the doc, is lxd.containers:

salt '*hv-04*' state.sls lxd.containers