2

I have installed Salt-master in my ubuntu 12.04 machine and salt minion in ubuntu 12.04. I want to install package containing like svn,mongodb,postgres,maven,python in the salt-minion. how to create package to install all these in salt minion?.Please do let me know.

when i run "sudo salt '*' state.highstate test=True"

@rome:~$ sudo salt '*' state.highstate test=True

i am getting the following error

paris:

State: - no
Name:      states
Function:  None
    Result:    False
    Comment:   No Top file or external nodes data matches found
    Changes:   

Summary

Succeeded: 0

Failed: 1

Total: 1

krs
  • 223
  • 1
  • 5
  • 1
    Do you mean just install these packages from the package repository? Then just add pkg: `svn, pkg.installed` (with proper newlines etc), as the docs say. I think I don't understand your specific question. – Halfgaar Feb 03 '14 at 08:05
  • let me know where to add this line? – krs Feb 03 '14 at 08:11
  • 1
    you have to create a top.sls and then a salt state like mypackages.sls, references by top.sls. This is plainly documented. – Halfgaar Feb 03 '14 at 08:22
  • can you provide a package file for above and how it needs to be installed (command)? – krs Feb 03 '14 at 09:28

1 Answers1

0

First create a mypackages.sls file with your packages

vim:
  pkg.installed

postgres:
  pkg.installed

examplewithexplicitname:
  pkg.installed:
    - name: mongodb

You need to put that in your top for selected hosts ('*'):

# cat top.sls
'*':
  - mypackages

Then test it:

salt '*' state.highstate test=True
Halfgaar
  • 7,921
  • 5
  • 42
  • 81
  • what is examplewithexplicitname? do let me know – krs Feb 03 '14 at 10:51
  • do explain this step You need to put that in your top for selected hosts ('*'): # cat top.sls '*': - mypackages – krs Feb 03 '14 at 10:54
  • That was to let you know to create a state that is not named after the package your installing. Normally, `name` is inferred from the state name, but you can specify it by hand with `- name:` – Halfgaar Feb 03 '14 at 10:56
  • kindly take note of it. this is my result http://pastebin.com/ZGsHmfGP – krs Feb 03 '14 at 11:04
  • With the salt docs, you should have enough information to add that to your top and apply it to your minions. – Halfgaar Feb 03 '14 at 12:09
  • @halfgaar-this is mypackage.sls http://pastebin.com/Auk6ehb2 – krs Feb 04 '14 at 06:12
  • Not the main error, but still an error: you don't seem to have proper indentation in your config. Anyway, with the information given, plus the documentation, you should be able to figure out. Please take the time to study the documentation. – Halfgaar Feb 04 '14 at 08:04
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/12833/discussion-between-krs-and-halfgaar) – krs Feb 04 '14 at 08:53