dev/Puppet_Readme.md
author ymh <ymh.work@gmail.com>
Fri, 10 Apr 2015 16:10:25 +0200
changeset 88 1e15fe538d93
parent 10 7d016d52be36
permissions -rw-r--r--
increment version to 0.2.2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
     1
# Puppet provisioning ReadMe
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
     2
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
     3
This document will describe how to set up a Puppet-provisioned Vagrant VM ready for development, as well as the inner working of the provisioning.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
     4
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
     5
## How to use:
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
     6
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
     7
### Requirements:
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
     8
- Oracle VirtualBox 4.3.12
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
     9
- Vagrant 1.6.5
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    10
- Mercurial (to get the source code of the project)
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    11
- Git (to clone the required subrepositories if necessary)
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    12
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    13
NOTE: Make sure your git and mercurial pulls are set to clone the file "as-is", especially if you're on Windows, due to all kind of line ending problems that can occur if you don't.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    14
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    15
### Installing
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    16
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    17
Once you have installed VirtualBox and Vagrant on your machine, pull the mercurial repository in a directory of your choice (we'll refer to it as /root/ from now on). Check if you have the following directories in /root/dev/modules:
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    18
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    19
- apt
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    20
- concat
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    21
- postgresql
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    22
- stdlib
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    23
- sysconfig
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    24
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    25
If you miss all the modules save sysconfig, this means the subrepositories didn't import properly. To remedy this, look up the /root/.hgsub files and use git clone commands to manually import the missing modules in their respective directories.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    26
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    27
You can customize the installation (modifying database names and informations, or virtualenv location for instance) by creating a custom.yaml file from the custom.yaml.tmpl file in the /root/dev/ directory and uncommenting values you want to override. This is by no means necessary and puppet will manage to set up your machine using default values if you don't.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    28
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    29
Once all the files are here and your options are properly configured, you just have to run the following command from /root/dev:
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    30
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    31
    vagrant up
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    32
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    33
Once the vagrant up command is done setting up the machine, run this command
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    34
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    35
    vagrant reload
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    36
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    37
So it fixes a bug with shared folders (see below).
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    38
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    39
This will set up the virtualbox and provision it via puppet. From there, you can ssh into your machine, activate your virtualenv from the directory you specified in the config file (default is /home/vagrant/my<IRIproject>env/).
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    40
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    41
Your /root/ directory will be located on the virtual machine in the /srv/ directory.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    42
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    43
###Notes and known bugs
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    44
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    45
Windows users can experience a bug with shared folder (shared folders would only work the first time you setup the vm) due to the way Windows (doesn't) handle symlinks. Here are the steps to fix it manually:
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    46
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    47
* ssh into the machine
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    48
* run the following command:
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    49
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    50
        sudo /etc/init.d/vboxadd setup
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    51
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    52
* then from the host machine vagrantfile directory, run
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    53
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    54
        vagrant reload
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    55
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    56
The machine should then set up correctly when you use 'vagrant up'
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    57
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    58
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    59
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    60
#How it works
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    61
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    62
## Some little things about Puppet
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    63
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    64
Puppet syntax is declarative. This means that for Puppet to automatically set up your VM, you basically just have to tell Puppet the resources you need installed on your VM, the commands it must run when required, as well as the order in which Puppet should do all this.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    65
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    66
Puppet will need 2 things to run properly:
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    67
* a .pp manifest file and the path to it, ours is site.pp, which we put in the root/dev/manifests directory. This manifest is the backbone of the puppet script and the one we use to arrange all our provisioning so Puppet installs everything in the right order.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    68
* a path to find required modules, which we put in the /root/dev/modules directory.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    69
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    70
These informations must be provided to Vagrant so it knows that we will set up our VM with puppet. If you open the VagrantFile, you will see these lines around the end of the file:
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    71
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    72
    config.vm.provision :puppet do |puppet|
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    73
        puppet.manifests_path = "manifests"
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    74
        puppet.manifest_file  = "site.pp"
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    75
        puppet.module_path    = "modules"
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    76
        puppet.options        = "--hiera_config /vagrant/hiera.yaml"
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    77
        puppet.facter = {
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    78
          "vagrant_base_path" => File.dirname(__FILE__)
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    79
    }
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    80
    end
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    81
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    82
This bit of code tells Vagrant to use Puppet to provision the machine, and specify the different informations we talked about just above. The last one we need to describe is the puppet.option line, which tells puppet to check the hiera.yaml file. This file is used to tell puppet where to find the files containing the definitions of the global configuration variables: basically it tells puppet to check our config.yaml file and from there set the appropriate global variables.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    83
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    84
## A look at site.pp
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    85
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    86
Here is our site.pp file:
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    87
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    88
    exec {
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    89
    'apt_update_site':
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    90
      command     => '/usr/bin/apt-get update',
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    91
      timeout     => 2400,
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    92
      returns     => [ 0, 100 ];
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    93
      #refreshonly => true;
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    94
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    95
    }
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    96
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    97
    Exec["apt_update_site"] -> Package <| |>
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    98
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
    99
    # upgrade system
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   100
    class { 'sysconfig::sys_upgrade': }->
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   101
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   102
    # params
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   103
    class { 'sysconfig::params': }->
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   104
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   105
    # install packages
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   106
    class { 'sysconfig::packages': }->
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   107
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   108
    # install postgres
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   109
    class { 'sysconfig::postgresql': }->
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   110
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   111
    # set up the virtualenv
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   112
    class { 'sysconfig::virtualenv': }
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   113
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   114
The first exec block runs the apt-get update command. Just below this we have the Exec["apt_update_site"] -> Package <| |> which is meant to tell Puppet "do the "apt_update_site" command before installing any package resource".
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   115
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   116
Then we have a number of class declarations, which are all subclasses of the "sysconfig" class from the "sysconfig" submodule, which is the custom module for puppet provisioning we are building. Each class has a corresponding .pp file with the relevant instructions in, located in /root/dev/modules/sysconfig/manifests/. This way we can properly identify what each file do and most importantly when. You will notice the -> at the end of class declarations, this is used to tell Puppet in which order it must process the different classes we have declared.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   117
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   118
At the end of the file is an exec command that will be executed last, meant to fix the shared folders problems we can encounter on Windows.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   119
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   120
### The Sysconfig submodule
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   121
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   122
The Sysconfig submodule is our main module. All the .pp manifests can be found in the /root/dev/modules/sysconfig/manifest folder. A notable one is init.pp which is a mandatory manifest in any Puppet submodule containing the sysconfig class definition. All the other manifests are the subclasses of the sysconfig class that are called in site.pp.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   123
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   124
* sys_upgrade class
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   125
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   126
This class executes commands such as apt-get upgrade and apt-get dist upgrade, as well as adding the apt postgresql repository and key to the sources.list.d folder so the postgresql module will get it from there when installing postgresql.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   127
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   128
* params class
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   129
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   130
This class has a number of hiera(var_name, default_value) calls, which Puppet uses to set a the variable named var_name to the corresponding value from the config file mentioned in the hiera.yaml file. If there is no config.yaml file or it can't find your config.yaml file (it can be because you didn't make one), it will set the variable to default_value.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   131
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   132
This is the class where you can find all the default values for the variables used in the puppet provisioning.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   133
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   134
* packages class
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   135
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   136
A straightforward class that will install all the required packages for your provisioning that you would normally install via apt-get install command if you didn't use puppet. It use the puppet Package resource for this. The package list is not generated so if you need a new package at some point, you'll have to add it here for it to be installed automatically on new VMs.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   137
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   138
* postgres class
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   139
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   140
This class will install and setup Postgresql according to the parameters specified in config.yaml.
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   141
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   142
* virtualenv class
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   143
54f4e0f9d636 Initial commit
Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
parents:
diff changeset
   144
This class will set up the virtual env in the directory mentioned in config.yaml and install all python packages listed in virtualenv/requirements.txt