Salt + reclass + system states

61 views
Skip to first unread message

codecat-

unread,
Jan 22, 2018, 8:32:37 AM1/22/18
to Salt-users
Hi there!

I am starting to use salt stack and while planning infrastructure i have started to use reclass(great tool actually).
There is no problems with anything except system states(like salt.states.network/etc).


If someone has experience using reclass with full system configuration, i will be very grateful for examples or direction in which i need to dig.


Thank you.
Regards,

Daniel Wallace

unread,
Jan 22, 2018, 8:36:54 AM1/22/18
to Salt-users

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/07f603f2-0510-4ccb-ba50-affd4f1c92bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

martin f krafft

unread,
Jan 22, 2018, 2:36:39 PM1/22/18
to Salt-users
also sprach Daniel Wallace <dwal...@saltstack.com> [2018-01-23 00:36 +1100]:
> You can user reclass for the master_tops and as an external pillar

I believe Andrey was asking about system.states. Is Salt able to use
ENC data for system.states, i.e.
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.network.html?

--
@martinkrafft | http://madduck.net/

no. no musicals. i loathe musicals. i never did have a plan for
doing one. my cousin made me sit through some fucking musical twice.
i just hate them. they bore me stiff. i think they’re just horrible.
even _hair_. and they're always lousy music.
 -— john lennon, _the lost interviews_ by ray connolly

spamtraps: madduc...@madduck.net
digital_signature_gpg.asc

Daniel Wallace

unread,
Jan 22, 2018, 3:34:53 PM1/22/18
to Salt-users
I don't know what ENC data is, but reclass can be used to specify pillar data, and that is what the reclass docs talks about using, so... extrapolate from there.


--
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+unsubscribe@googlegroups.com.

Thomas Phipps

unread,
Jan 22, 2018, 3:38:05 PM1/22/18
to salt-...@googlegroups.com
there is a reclass top master top adapter. however that does not build states either. you still need to build the states that reclass will call in it's application list. 
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/07f603f2-0510-4ccb-ba50-affd4f1c92bb%40googlegroups.com.

Thomas Kula

unread,
Jan 22, 2018, 3:56:38 PM1/22/18
to salt-...@googlegroups.com
My Salt setups have migrated to use reclass as both the ENC and pillar
source --- I don't have any Salt top files, it all comes out of reclass.

Reclass allows you to define pillar data (what reclass calls parameters)
and which states a node will have applied to it (what reclass calls
applications).

States are still defined as you would normally define them in Salt.
Reclass knows nothing about states, other than, when asked about a node,
it will build up a list of 'applications' which that node needs; the
Salt integration treats those as the states it needs to make sure is on
the node and will apply them as normal.

I've set up my master to have the Salt master and the reclass config all
come out of the same directory, which looks like:

classes
nodes
reactor
states

The first two reclass cares about, the second two Salt does.

I've been meaning to write this up as an article for a while, perhaps I
should find enough gumpt ions to do that this weekend.



--
Thomas L. Kula | ku...@tproa.net | http://kula.tproa.net/

codecat-

unread,
Jan 23, 2018, 12:15:13 AM1/23/18
to Salt-users
Thanks for replies!

The idea of usage of reclass for things like this - avoiding of usage of salt sls files.
Full parametrization allows to build really self explained and self documented infrastructure.
All "external" formulas are applying just well, but not internal ones.
Would be not very good if i will need to write formulas for system states(as it's will increase complexity of support).
I assume actually that we can built some kind of best practice, as parametrized infrastructure is way more efficient then any other(tested already on puppet/ansible/chef).

Thanks for replies.
Reply all
Reply to author
Forward
0 new messages