Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

State in SLS file is not formed as a list

I've got an sls file; the contents of which follow:

apache:
 pkg.installed:
    -name: apache2
 service.running:
   -enable: True
   - require:
     - pkg: apache

And I'm getting the error when trying to provision an Ubuntu Vagrant box with salt using the salt-master:

State 'apache' in SLS 'webserver' is not formed as a list

I've tried editing it and I've noticed that you can't have a chunk of code ending in a : but I can't see what's wrong with this.

The salt-master is running on an Ubuntu box and the key is accepted. I'm new to salt!

I've just put it through an on-line YAML parser and it seems to be okay. Wot is I missin'?

like image 606
David Boshton Avatar asked Dec 25 '22 01:12

David Boshton


1 Answers

I don't think you need the double space indent, mine works with single, but you do need a space after the dashes.

apache:
  pkg.installed:
    - name: apache2
  service.running:
    - enable: True
    - require:
      - pkg: apache
like image 111
Johnathan Herndon Avatar answered Jan 01 '23 14:01

Johnathan Herndon