Hey sorthum,

Sorry for the late reply, I'm going through old unanswered threads.

Sounds like you mostly have a handle on everything, and I'm betting that this decision has already been made. But I figured I'd answer your question anyway: I would use a single topfile in `/srv/salt/base`. (It can't be in /srv/salt, because that's not one of your environments)

The reason I recommend this is because top data is compiled across all environments. Thus, you should always try to avoid having conflicting data in your top files, because they will all be compiled together, and although conflict resolution is consistent, it still makes for a fragile point in your infrastructure.

If you do put a topfile in each environment, I recommend only defining a single environment in each topfile (the environment in which the topfile lives).

Hope that helps.

Colton Myers (basepi)
Platform Engineer, SaltStack
On Oct 9, 2014, at 11:44 AM, sorthum@gmail.com wrote:

I'm trying to refactor an existing salt environment, and I find myself somewhat conflicted about the best way to proceed.

The environment's been largely unmaintained for a couple of years, so bringing it in line with current best practices is my primary goal; right now it's roughly 400 nodes across the board, but it's expected to scale soon.

Right now a script pulls node assignments from an external database as a external_top. The database then obliges the request by falling over under load, so I'd like very much to remove it from the equation.

Today, the tree looks something like:

├── base
├── dev
├── intg
└── prod

Inside of each environment, we see:
├── config
├── _grains
├── host
├── location
├── _modules
└── role

Note that (today) there are no top files, as it's all being handled externally.

I'd like to remove the database dependency and bring it into a scenario where we can use top files.

Fortunately the minions are sanely named, so glob-matching works well. The best-practices question I've got is "do I want to do this all in /srv/salt/top.sls, or do I want to hand off to (for instance) /srv/salt/intg/top.sls? Note that as of right now, there are no top.sls files anywhere due to the (ab)use of this database.

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

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupsalt-users @
postedOct 9, '14 at 5:44p
activeNov 12, '14 at 11:45p

2 users in discussion

Sorthum: 1 post Colton Myers: 1 post



site design / logo © 2022 Grokbase