Update to Go 1.6 & Debian 7
This commit is contained in:
15
environments/development/manifests/init.pp
Normal file
15
environments/development/manifests/init.pp
Normal file
@@ -0,0 +1,15 @@
|
||||
stage { "prepare":
|
||||
before => Stage["main"],
|
||||
}
|
||||
|
||||
class setup {
|
||||
exec { "update-aptitude":
|
||||
command => "/usr/bin/apt-get update -y",
|
||||
}
|
||||
}
|
||||
|
||||
class {
|
||||
"setup":
|
||||
stage => prepare;
|
||||
"golang":;
|
||||
}
|
||||
47
environments/development/modules/golang/manifests/init.pp
Normal file
47
environments/development/modules/golang/manifests/init.pp
Normal file
@@ -0,0 +1,47 @@
|
||||
class golang ( $version = "1.6" ) {
|
||||
|
||||
exec { "download-golang":
|
||||
command => "/usr/bin/wget --no-check-certificate -O /usr/local/src/go$version.linux-amd64.tar.gz http://golang.org/dl/go$version.linux-amd64.tar.gz",
|
||||
creates => "/usr/local/src/go$version.linux-amd64.tar.gz"
|
||||
}
|
||||
|
||||
exec { "remove-previous-version":
|
||||
command => "/bin/rm -r /usr/local/go",
|
||||
onlyif => "/usr/bin/test -d /usr/local/go",
|
||||
before => Exec["unarchive-golang-tools"]
|
||||
}
|
||||
|
||||
exec { "unarchive-golang-tools":
|
||||
command => "/bin/tar -C /usr/local -xzf /usr/local/src/go$version.linux-amd64.tar.gz",
|
||||
require => Exec["download-golang"]
|
||||
}
|
||||
|
||||
exec { "setup-path":
|
||||
command => "/bin/echo 'export PATH=/vagrant/bin:/usr/local/go/bin:\$PATH' >> /home/vagrant/.profile",
|
||||
unless => "/bin/grep -q /usr/local/go /home/vagrant/.profile ; /usr/bin/test $? -eq 0"
|
||||
}
|
||||
|
||||
exec { "setup-workspace":
|
||||
command => "/bin/echo 'export GOPATH=/vagrant' >> /home/vagrant/.profile",
|
||||
unless => "/bin/grep -q GOPATH /home/vagrant/.profile ; /usr/bin/test $? -eq 0"
|
||||
}
|
||||
|
||||
if ! defined(Package["git"]) {
|
||||
package { "git":
|
||||
ensure => present,
|
||||
}
|
||||
}
|
||||
|
||||
if ! defined(Package["bzr"]) {
|
||||
package { "bzr":
|
||||
ensure => present,
|
||||
}
|
||||
}
|
||||
|
||||
if ! defined(Package["mercurial"]) {
|
||||
package { "mercurial":
|
||||
ensure => present,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user