I have just setup Foreman for the first time & am not sure how to go about putting all of my configurations under version control. I know I can use Git for each module I install on my Puppet master but would prefer a more holistic solution that encompasses not just modules but also what classes are associated with each host and any variables set on the hosts. Any suggestions would be greatly appreciated along with related workflows. In case it's relevant, I do have GitLab setup as a central Git server on site and plan to setup a CI server such as Jenkins soon.
There is a plugin to keep your infrastructure definition in Foreman, pretty much a serialized version of your data in Git, and upload (and change your infrastructure) changes. Maybe that'd be useful for you
With foreman you should be able to view all classes along with any configuration variable assigned in the host details. See: http://theforeman.org/manuals/1.4/index.html.
I am not sure if i understand your question but did you came across "puppet librarian" https://github.com/rodjek/librarian-puppet? There you are able to define which versions/sha1 of puppet modules you like to use.
Just in case someone is reading this later: With puppet you are able to define which version of package/software you would like to install with the "version => X.Y.Z" declaration.
Gene, i tried my best but i still dont get your question. Sorry for that :(
I think what you are after is very simple.
The Puppet configs are in
/etc/puppet. The most simple option is just to run
git init /etc/puppet/
you can then add Gitlab as a remote and push to it.
Alternatively, you could try something like what I describe here which is not Foreman-centric, but I see no reason why you could not use it as inspiration.
You might also consider etckeeper, which does it automatically
You even could write a wrapper like
#!/bin/bash # variables ETCKEEPER=`which etckeeper` ETCKEEPER_MSG=$1 PUPPET=`which puppet` PUPPET_CMD=$2 # Msg would be your commit msg etckeeper commit $ETCKEEPER_MSG # PUPPET_CMD e.g. apply puppet $PUPPET_CMD
i'm working with this for awhile and its okay for my needs.
I think you just need to setup a repository in git where each branch of the git repo will map to a puppet environment and when you want to change something in puppet , just clone the repo , make changes , and push it to the corresponding branch. You also need to setup a git hook that will fire when you push your changes to the git repo so that it updates the mapped environment on puppet server. You can do all this either manually or just through this puppet module.