The Architecture:
R10k deploy all modules from git repository based on Puppetfile, each module can have its own branches.
-
install r10k
gem install r10k
2. Create cache directory:
mkdir /var/cache/r10k
3.create r10k.yaml file:
# more /etc/r10k.yaml
:cachedir: /var/cache/r10k
:sources:
:local:
remote: git@bitbucket.org:robertchen668/r10k-site.git
basedir: /etc/puppet/environments
4. create a Puppetfile
5. in site.pp, include the classes
hiera_include(‘classes’)
root@puppet:/etc/puppet/environments# r10k deploy environment production -p
root@puppet:/etc/puppet/environments/production# r10k deploy environment testing -p
root@puppet:/etc/puppet/environments# ls
production testing
changed something:
root@puppet:~/r10k-site# git push origin production
The post Using Puppet with r10k, hiera and bitbucket appeared first on Robert Chen.