SM3: Custom Salt States with source entry

Hi all,

I’ve set up the new Suse Manager 3.1 and hope that anybody could help me with Salt. I’m wondering how to implement a custom salt state with a source entry in it when creating one under Salt → State Catalog?
For example:
I wanted to apply the following state:

/etc/ssh/sshd_config:
file.managed:
- name: /etc/ssh/sshd_config
- source: salt://sshd/files/config/sshd_config
- user: root
- group: root
- file_mode: 644

In that case, where do I have to put the config file? Or can I only create a state under /srv/salt and have to apply the state manually via command line?
Is there a way to get the states created unter /srv/salt into the state catalog? I haven’t found anything in the documentation. Only how to create a simple state with pkg.installed …

Thanks in advance for your help!!

Matze

[QUOTE=matze502;39112]Hi all,

I’ve set up the new Suse Manager 3.1 and hope that anybody could help me with Salt. I’m wondering how to implement a custom salt state with a source entry in it when creating one under Salt → State Catalog?
For example:
I wanted to apply the following state:

/etc/ssh/sshd_config:
file.managed:
- name: /etc/ssh/sshd_config
- source: salt://sshd/files/config/sshd_config
- user: root
- group: root
- file_mode: 644

In that case, where do I have to put the config file? Or can I only create a state under /srv/salt and have to apply the state manually via command line?
Is there a way to get the states created unter /srv/salt into the state catalog? I haven’t found anything in the documentation. Only how to create a simple state with pkg.installed …

Thanks in advance for your help!!

Matze[/QUOTE]

Hello Matze,

the salt-states are stored at /srv/susemanager/salt/manager_org_1/

In youre situation maybe /srv/susemanager/salt/manager_org_1/sshd.sls (when you call youre state sshd)

and the files are stored at:
/srv/salt/

this location are all described at
[LIST]
[*]https://www.suse.com/documentation/suse-manager-3/book_suma_getting-started_31/data/salt_gs_guide_salt_file_locations.html
[/LIST]

and configured at: /etc/salt/master.d/susemanager.conf

regards
Franz

Hi Franz,

thanks for the infos. Ok, I thought that there will be another option to maintain the used files also from the GUI just like I did with the state itself.
I’ve now put the files to /srv/salt and it works like a charm.

Thanks!!

Matze