Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleSet up hiera datafiles
root@bootstrap:~# mkdir /etc/puppetlabs/puppet/data
root@bootstrap:~# cd /etc/puppetlabs/puppet/data
root@bootstrap:/etc/puppetlabs/puppet/data# mkdir nodes
root@bootstrap:/etc/puppetlabs/puppet/data# touch common.yaml networking.yaml packages.yaml sensu.yaml users.yaml nodes/bootstrap.infra.skyhigh.iik.ntnu.no.yaml
root@bootstrap:/etc/puppetlabs/puppet/data# git init .
Initialized empty Git repository in /etc/puppetlabs/puppet/data/.git/
root@bootstrap:/etc/puppetlabs/puppet/data# git add .
root@bootstrap:/etc/puppetlabs/puppet/data# git commit -m "Initial import"

...

Code Block
titleConfigure hiera
root@bootstrap:/etc/puppetlabs/puppet# wget https://githubraw.githubusercontent.com/ntnusky/profile/blob/infrastructuremaster/files/puppet/hiera.yaml
   ...
2017-12-22 14:18:52 (334 KB/s) - 'hiera.yaml.1' saved [72001]
root@bootstrap:/etc/puppetlabs/puppet# mv hiera.yaml.1 hiera.yaml

Next up is populating the hiearchi with information based on this wikipage., and commiting this to the git repository

Code Block
titleSet up hiera datafiles
root@bootstrap:/etc/puppetlabs/puppet/data# git add common.yaml networking.yaml packages.yaml users.yaml
root@bootstrap:/etc/puppetlabs/puppet/data# git commit -m "Initial data"

Add the class "role::bootstrap" to the node-specific hierafile so that the role can be set before the ENC is up and running. You should also configure the dashboard on bootstrap to not use the load-balancer before bootstrap is fully installed. Please see the example how the node-specific hierafile can look like. Also make sure that sensu and munin is set to not be installed; as we need the servers installed before we install the clients.

Code Block
titleDefine role for bootstrap
root@bootstrap.infra.skyhigh.iik.ntnu.no:/etc/puppetlabs/puppet/data# cat nodes/bootstrap.infra.skyhigh.iik.ntnu.no.yaml 
---
classes:
 - 'role::bootstrap'

profile::interfaces:
 - 'eno1'

profile::puppet::altnames:
 - 'puppet.skyhigh.iik.ntnu.no'
 - 'puppetdb.skyhigh.iik.ntnu.no'

profile::interfaces::eno1::method: 'static'
profile::interfaces::eno1::address: '10.212.132.9'
profile::interfaces::eno1::netmask: '255.255.255.0'
profile::interfaces::eno1::gateway: '10.212.132.1'
profile::interfaces::eno1::tableid: 1

profile::interfaces::management: 'eno1'
profile::dhcp::pxe::server: "%{hiera('profile::interfaces::eno1::address')}"
profile::dashboard::database::host: "%{hiera('profile::interfaces::eno1::address')}"

profile::haproxy::web::profile: 'management'

root@bootstrap:/etc/puppetlabs/puppet/data# grep install: common.yaml 
profile::munin::install: false
profile::sensu::install: false

Start the installation

Code Block
titleStart the installation
root@bootstrap:/etc/puppetlabs/puppet/data# systemctl restart puppetserver
root@bootstrap:/etc/puppetlabs/puppet/data# puppet agent --test --server puppet.skyhigh.iik.ntnu.no --environment infrastructure

At this point puppet should be able to configure most of whats needed. Puppet will also configure the master to use shiftleader as an ENC, so it is expected that puppet would stop work after the puppet-run until we have fed the dashboard with useful information.

Access shiftleader, and add initial information

Add a line in your local hosts-file pointing your dashboard-name to the machine you just installed. Open your web-browser pointing at this name. You should get a login-page where you can attempt to log in. The login should be declined as your user does not yet have acces. Access can be granted to users like so:

Code Block
titleGrant access to shiftleader
root@bootstrap.infra.skyhigh.iik.ntnu.no:~# /opt/shiftleader/manage.py ldap_promote <username>

At this point you should be able to log into the dashboard. Now you need to add a couple of things trough the webinterface:

  • Deploy at least one puppet environment for the dashboard to discover your roles.
  • Add the bootstrap machine, using its name/mac/ip/etc
  • Add DNS records for:
    • Puppet
    • Puppetdb
    • Mysql
    • The dashboard
    • The dashboard api (a v4-only record to the dashboard)
    • Postgres
    • The loadbalancer IP

Finalizing the installation

Now your installation should work. Remove all entries added to your host-file, both on your client and on the bootstrapping machine. Verify that everything (puppet, mysql, shiftleader etc) works.