This message was deleted.
# puppet
s
This message was deleted.
r
couple people here have played with
profile_service
patterns.
Copy code
class role::whatever {

  # must be first, controlled by SRE
  include profile::std
  # entry point for service owners
  include profile_whatever

}
the separation of
profile_$service
from module
service
allows good patterns in both the module and profile. Also ability to do hieradata in profile_ which is nice in larger environments.
l
I moved away from role:: and profile:: to making top level modules called role_$role and profile_$profile for all profiles and roles
because I can then version all of the profiles too
r
@Lumiere any particular experience or use case that sent you in that direction?
l
having a massive profile module made it unwieldy, and it make it hard to keep track of who was working where
and with r10k, being able to roll forward and back on profiles is very very useful
r
Interesting. The massive profile was what caused profile_service at least for large complicated services. In that case specifically hadoop. Always wanted to do it for Splunk which is a similar sized problem, but module needed a full rewrite to begin.
l
yea, we just decided it was worth it to do profile_* across the board, we even use profile_base and profile_$os
it also makes unit testing profiles sane
trying to unittest a monster profile tree takes forever
my zabbix profile already takes 30 minutes on its own
I had to implement ENV variables to allow a smoke test that only tests 2-3 sub versions
r
Nice. That's a lot farther than anyone, that I know of, has taken it.
l
our env is similar to what at lot of people see as standard, with some major differences
we don't do environments per "environment" so no dev/stage/prod/feature branch environments
we have a dev/test/staging/production puppet cluster with static application environments and in dev/test prefixed feature branches
d
When i was at Natwest we always had roles and profiles in modules seperate from the control repo and had <department_role> <deparment_profile> because we were all super siloed and didn't trust each other 😂
😅 1
u
Cool, thanks, sounds like I'm on the right track, the profile_ and role_ are a variant of this pattern I'd say. I already have too many modules, so not sure I wanna double it with that pattern, but it does make it easier to fine the profiles.
l
we fixed that by having an org in github enterprise for puppet modules and using r10k to place everything
u
Yeah, we're on enterprise, currently looking at WhatsaRanjit's idea of puppetfile as code. 100+ devs all writing to the same file seems like a bad time.
l
we solve that by separating environments, so each smaller dev team gets their own env with their own puppetfile
and then we have a shared infra/apps/db modules repo that are managed by the puppet team
and other devs can PR to
u
hmmm, maybe...that'd be a big rewrite of the way things work here.
...mostly inherited workflow
d
So right now are you setting commit ids or similar in the Puppetfile?
u
yeah, tags/release
l
for me, it's all tags
d
We used https://www.puppet.com/docs/pe/2019.8/puppetfile.html#declare_content_from_a_relative_control_repo_branch so that it was down to the devs on their modules creating the branches realtive to environment so they never had to edit puppet file
l
that's clever, it definitely doesn't match our workflow, because we don't have multiple branches in use
u
looked at that, it might work but need to redo a bunch of stuff here, without saying too much, I'll say I have more than 50 branches in my "deploy strategy"...using strategy very loosely
l
except in dev dynamics where we allow dyanmic branches for testing only