Skip to content
gloppasglop edited this page Nov 15, 2013 · 26 revisions

Puppet Master Installation

Create new VM from exoscale console

Ubuntu 13.04

Install Puppet Master

wget http://apt.puppetlabs.com/puppetlabs-release-raring.deb
sudo dpkg -i puppetlabs-release-raring.deb
sudo apt-get update
sudo apt-get install puppetmaster

Git

sudo apt-get install git

Fog

sudo apt-get install make
sudo apt-get install ruby-dev
sudo apt-get install rubygems
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1.1
sudo apt-get install libxslt1-dev


gem install fog

Check that version >=1.14.0 has been installed as it contains the changes that allows Fog to handle userdata and keypairs for cloudstack

Cloudstack Resource

puppet module install puppetlabs/stdlib

cd /etc/puppet/modules
git clone https://github.com/gloppasglop/cloudstack_resources.git

API

Exoscale console

Account Details/API Details

Create file: /etc/puppet/transport.yaml

cloudstack:
  host:                    'api.exoscale.ch'
  api_key:                 '<YOUR_API_KEY>'
  secret_access_key:       '<YOUR_SECRET_KEY>'
  path:                    '/compute'
  scheme:                  'https'
  port:                    '443'

Check if configuration correct

puppet resource cloudstack_instance
puppet resource cloudstack_image
puppet resource cloudstack_zone

Create an instance:

Edit test.pp

cloudstack_instance { 'testvm':
  ensure             => 'present',
  flavor             => 'Micro',
  image              => 'Linux Ubuntu 13.04 64-bit 10 GB Disk',
  keypair	     => Cloudstack_keypair['test_keypair'],
  require            => Cloudstack_keypair['test_keypair'],
  security_group_list => ['default'],
  zone               => 'CH-GV2',
}

cloudstack_keypair { 'test_keypair':
  ensure => 'present',
 cache_key => true,
}

Apply the manifest:

puppet apply test.pp

Check if instance created correctly:

puppet resource cloudstack_instance testvm

You should get something like:

cloudstack_instance { 'testvm':
  ensure              => 'present',
  account             => '[email protected]',
  domain              => '[email protected]',
  flavor              => 'Micro',
  id                  => '70f8d145-f732-4139-b820-b106fa4047da',
  image               => 'Linux Ubuntu 13.04 64-bit 10GB Disk',
  internal_ipaddress  => '185.19.28.31',
  keypair             => 'test_keypair',
  network             => 'guestNetworkForBasicZone',
  security_group_list => ['default'],
  state               => 'running',
  zone                => 'CH-GV2',
}

Install Puppet DB - Optional skip this chapter for now.

sudo puppet resource package puppetdb ensure=latest
sudo puppet resource service puppetdb ensure=running enable=true
sudo puppet resource package puppetdb-terminus ensure=latest

Config /etc/puppet/puppetdb.conf, puppet.conf, routes.yaml by following ** Step 2 ** of http://docs.puppetlabs.com/puppetdb/latest/connect_puppet_master.html

Restart puppet master.

Installing a Wordpress Stack

Doc to be completed

puppet module install puppetlabs/apache
puppet module install puppetlabs/mysql
puppet module install hunner-wordpress



/etc/puppet/modules
├── cloudstack_resources (???)
├── dalen-puppetdbquery (v1.0.4)
├── exoscale (???)
├── puppet-wordpress (v0.3.0)
├── puppetlabs-apache (v0.6.0)
├── puppetlabs-firewall (v0.3.0)
├── puppetlabs-mysql (v0.6.1)
├── puppetlabs-stdlib (v4.1.0)
└── ripienaar-concat (v0.2.0)

Hiera

autosign

Edit/create /etc/puppet/autosign.conf

*.internal

gem install deep_merge