Skip to content

Puppet Code to manage voxpupu.li

Hetzner cloud sponsors us a cloud instance. It's currently running Ubuntu 18.04. This repository works as a control repository for r10k.

The main purpose of this cloud instance is to run Vox Pupuli Tasks.

Bootstrap

Assume we've got a new Ubuntu 18.04 cloud instance:

wget https://apt.puppet.com/puppet7-release-bionic.deb
dpkg -i puppet7-release-bionic.deb
apt update
apt --yes upgrade
apt --yes install puppet-agent
source /etc/profile.d/puppet-agent.sh
puppet module install puppet-r10k
puppet apply -e 'include r10k'
sed -i 's#remote:.*#remote: https://github.com/voxpupuli/controlrepo.git#' /etc/puppetlabs/r10k/r10k.yaml
puppet resource package toml ensure=installed provider=puppet_gem
r10k deploy environment --modules --verbose --exclude-spec
puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp --show_diff

Hetzner Cloud cloud-init userdata:

#cloud-config
---
package_reboot_if_required: true
package_upgrade: true
packages:
- git
- ca-certificates
repo_update: true
repo_upgrade: all
puppet:
  install_type: aio
  collection: puppet8
  cleanup: false
  package_name: puppet-agent
  csr_attributes:
    extension_requests:
      pp_role: puppetserver
runcmd:
  - systemctl disable --now puppet
  - /opt/puppetlabs/puppet/bin/gem install --no-document r10k toml
  - cd /root && git clone https://github.com/voxpupuli/controlrepo
  - cd /root/controlrepo && /opt/puppetlabs/puppet/bin/r10k puppetfile install --verbose
  - /opt/puppetlabs/puppet/bin/puppet apply /root/controlrepo/manifests/site.pp --modulepath /root/controlrepo/modules:/root/controlrepo/site --show_diff --write_catalog_summary --hiera_config /root/controlrepo/hiera.yaml --summarize --graph --tags r10k,hacked_pluginsync
  - /opt/puppetlabs/puppet/bin/r10k deploy environment --modules --verbose
  - /opt/puppetlabs/puppet/bin/puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp --show_diff --environment production --write_catalog_summary --summarize --graph
  - /opt/puppetlabs/puppet/bin/puppet agent -t
  - /opt/puppetlabs/puppet/bin/puppet agent -t

ToDos

  • setup csr_attributes (cloud-inits supports that as well)
  • write the r10k config so we can do the initial provisioning into /etc/puppetlabs/code/environments and not /root

metadata.json and dependencies

the site/profiles/metadata.json only tracks modules that are direct dependencies to profiles. The .fixtures.yml can be autogenerated with the generate_fixtures rake task.

About

The puppet code that powers our dashboard

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages