diff options
| author | varac <varacanero@zeromail.org> | 2015-05-04 20:09:40 +0200 | 
|---|---|---|
| committer | varac <varacanero@zeromail.org> | 2015-09-10 14:43:49 +0200 | 
| commit | 36540162129243596a5ce1ecc00c999ba5ddc849 (patch) | |
| tree | 3ee180a3055517d09111198b160db12d79b71c98 | |
| parent | 9d645a82c7346e8d585c664a82c719647a0d2ffa (diff) | |
moved leap_cli installation to leap module
Change-Id: I385f7877d0816456e7c57179511604645a4740bc
| -rw-r--r-- | puppet/modules/leap/manifests/cli/install.pp | 33 | ||||
| -rwxr-xr-x | vagrant/install-platform.pp | 32 | 
2 files changed, 43 insertions, 22 deletions
| diff --git a/puppet/modules/leap/manifests/cli/install.pp b/puppet/modules/leap/manifests/cli/install.pp new file mode 100644 index 00000000..858bd7da --- /dev/null +++ b/puppet/modules/leap/manifests/cli/install.pp @@ -0,0 +1,33 @@ +# installs leap_cli on node +class leap::cli::install ( $source = false ) { +  if $source { +    # needed for building leap_cli from source +    include ::git +    include ::site_config::ruby::dev + +    vcsrepo { '/srv/leap/cli': +      ensure   => present, +      force    => true, +      revision => 'develop', +      provider => 'git', +      source   => 'https://leap.se/git/leap_cli.git', +      owner    => 'root', +      group    => 'root', +      notify   => Exec['install_leap_cli'], +      require  => Package['git'] +    } + +    exec { 'install_leap_cli': +      command     => '/usr/bin/rake build && /usr/bin/rake install', +      cwd         => '/srv/leap/cli', +      refreshonly => true, +      require     => [ Package['ruby-dev'], File['/etc/gemrc'], Package['rake'] ] +    } +  } +  else { +    package { 'leap_cli': +      ensure   => installed, +      provider => gem +    } +  } +} diff --git a/vagrant/install-platform.pp b/vagrant/install-platform.pp index 465ca78a..5ea834b1 100755 --- a/vagrant/install-platform.pp +++ b/vagrant/install-platform.pp @@ -3,34 +3,22 @@ File['/etc/apt/preferences'] ->    Exec['refresh_apt'] ->    Package <| ( title != 'lsb' ) |> -package { [ 'rsync', 'ruby-hiera-puppet', 'git', 'ruby1.9.1-dev', 'rake', 'jq' ]: -  ensure => installed -} - -file { '/etc/gemrc': -  content => "---\n:sources:\n  - https://rubygems.org/" -} -vcsrepo { '/srv/leap/leap_cli': -  ensure   => present, -  force    => true, -  revision => 'develop', -  provider => 'git', -  source   => 'https://leap.se/git/leap_cli.git', -  owner    => 'root', -  group    => 'root', -  notify   => Exec['install_leap_cli'], -  require  => Package['git'] +if $::lsbdistcodename == 'wheezy' { +  package { 'ruby-hiera-puppet': +    ensure => installed +  }  } -exec { 'install_leap_cli': -  command     => '/usr/bin/rake build && /usr/bin/rake install', -  cwd         => '/srv/leap/leap_cli', -  refreshonly => true, -  require     => [ Package['ruby1.9.1-dev'], File['/etc/gemrc'], Package['rake'] ] +# install leap_cli from source, so it will work with the develop +# branch of leap_platform +class { '::leap::cli::install': +  source  => true,  }  file { [ '/srv/leap', '/srv/leap/configuration', '/var/log/leap' ]:    ensure => directory  } +# install prerequisites for configuring the provider +include ::git | 
