Difference between revisions of "Infrastructure Team/Puppet"
(→Nodes) |
|||
Line 47: | Line 47: | ||
#!/bin/bash | #!/bin/bash | ||
− | + | sh /usr/share/doc/git-core/contrib/hooks/post-receive-email | |
git checkout -f | git checkout -f | ||
− | + | puppet kick $(for i in $(ls /etc/puppet/manifests/nodes/*.pp); do echo $(basename $i .pp); done) || true | |
− | |||
− | |||
=== Repository hierarchy === | === Repository hierarchy === |
Revision as of 00:26, 15 November 2010
Sugar Labs Puppet infrastructure.
Modules
Puppet modules configure particular services like git.sugarlabs.org or MySQL but not tied to final configurations, they are being configured from puppetmaster.
All modules are collected as repositories in puppets Gitorious project. Modules might be created from scratch or mirrored from upstream, so, all modules that are used within Sugar Labs are stored in one place. Module repository might have followed branches:
- master, development version (might be absent if project is mirrorred from upstream),
- production, version is being used in production,
- upstream, if it is mirrorred project.
Auto generated documentation.
Master
Only puppetmaster keeps final configuration for all Sugar Labs services. It is being started on security machine in private git repository.
Private repository
/var/lib/puppet/etc/puppet.git
/var/lib/puppet/etc/puppet
detached working directory/etc/puppet
symlink to detached working directory/var/lib/puppet/etc/puppet.git/config
:
[core] repositoryformatversion = 0 filemode = true bare = false sharedRepository = true logallrefupdates = true worktree = /etc/puppet [receive] denycurrentbranch = ignore [hooks] mailinglist = systems-logs@... emailprefix = "[PUPPET] " showrev = "git show -C %s; echo"
/var/lib/puppet/etc/puppet.git/description
:
Sugar Labs Puppet configuration
/var/lib/puppet/etc/puppet.git/hooks/post-receive
#!/bin/bash sh /usr/share/doc/git-core/contrib/hooks/post-receive-email git checkout -f puppet kick $(for i in $(ls /etc/puppet/manifests/nodes/*.pp); do echo $(basename $i .pp); done) || true
Repository hierarchy
Git repository consists of:
modules/
, all used modules from puppets project in form of submodules.manifests/site.pp
, main recipe which contain common settings and includes nodes.manifests/roles/
, recipes that describes final configuration for particular service.manifests/nodes/
, puppetized nodes, configuration for hosts that ask puppetmaster.
Nodes
Hosts that fetch configuration from the puppetmast need puppet >= 2.6
package. If puppet
was installed from gems, it needs to be initially configured:
puppetmasterd --mkusers
Node's puppet agent might have optional configuration in /etc/puppet/puppet.conf
:
[main] runinterval = <fetch-configuration-in-every-n-seconds> report = true
Every puppetized host should have particular node file in manifests/nodes/<host-name>.pp
on puppetmaster.