Error: Too many functions declared in state 'file' in SLS

1,067 views
Skip to first unread message

buddi hemanthkumar

unread,
Dec 25, 2015, 1:47:45 PM12/25/15
to Salt-users
Hi all am very new to Salt Stack , when i ran the High state and my recipe is

 tmp_create_dirs:
  file.directory:
    - names:
    - {{ salt['pillar.get']('user_home') }}/tmp/
    - mode: 750
    - makedirs: True


and am getting error ####   Too many functions declared in state 'file' in SLS  ########

Ted Strzalkowski

unread,
Dec 26, 2015, 1:08:07 PM12/26/15
to Salt-users
You simply have indentation errors.  As a side note, in Salt lingo, we call them states, not recipes.  Indent the arguments to 'names' one level and you'll be good (see https://docs.saltstack.com/en/latest/ref/states/highstate.html#names-declaration).

Colton Myers

unread,
Jan 8, 2016, 4:51:52 PM1/8/16
to salt-...@googlegroups.com
The resulting state will look like this:

 tmp_create_dirs:
  file.directory:
    - names: 
      - {{ salt['pillar.get']('user_home') }}/tmp/
    - mode: 750
    - makedirs: True

Cheers!

--
Colton Myers
Core Engineer, SaltStack
@basepi on Twitter/Github/IRC

Registration for SaltConf 2016 is open! http://saltconf.com/register/

--
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+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages