Puppet Class: weave::install

Inherits:
weave::params
Defined in:
manifests/install.pp

Overview

Parameters:

  • ensure (Any) (defaults to: $weave::params::ensure)
  • weave (Any) (defaults to: $weave::params::weave)
  • docker (Any) (defaults to: $weave::params::docker)
  • weave_image (Any) (defaults to: $weave::params::weave_image)
  • weave_image_tag (Any) (defaults to: $weave::params::weave_image_tag)
  • weave_container (Any) (defaults to: $weave::params::weave_container)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'manifests/install.pp', line 2

class weave::install (
  $ensure = $weave::params::ensure,
  $weave = $weave::params::weave,
  $docker = $weave::params::docker,
  $weave_image = $weave::params::weave_image,
  $weave_image_tag = $weave::params::weave_image_tag,
  $weave_container = $weave::params::weave_container,
) inherits weave::params {

  package { [ 'ethtool',
              'conntrack' ]:
    ensure => $ensure,
  }

  # wget -O weave/files/usr/local/bin/weave https://raw.githubusercontent.com/zettio/weave/master/weaver/weave
  file { "$weave": 
    ensure => $ensure,
    source => "puppet:///modules/weave${weave}",
      mode => '0755',
  }

  docker::image { "$weave_image":
       ensure => $ensure,
    image_tag => $weave_image_tag,
  }

  if member(['absent','purged'], $ensure){ 

    exec { 'docker_rm_weave_container':
      command => "$docker stop $weave_container && $docker rm $weave_container",
    }

    notify { "ensure is $ensure": }

  }

}