Skip to content

Instantly share code, notes, and snippets.

@rail
Created January 16, 2013 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rail/4551139 to your computer and use it in GitHub Desktop.
Save rail/4551139 to your computer and use it in GitHub Desktop.
modules/buildslave/manifests/startup/desktop.pp | 6 +++---
modules/packages/manifests/fonts.pp | 6 ++++++
modules/packages/manifests/mercurial.pp | 2 +-
.../packages/manifests/mozilla/py27_mercurial.pp | 19 +++++++++++--------
modules/packages/manifests/mozilla/python27.pp | 13 ++++++++++---
modules/packages/manifests/puppet.pp | 4 +++-
6 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/modules/buildslave/manifests/startup/desktop.pp b/modules/buildslave/manifests/startup/desktop.pp
index 43433a7..8254be4 100644
--- a/modules/buildslave/manifests/startup/desktop.pp
+++ b/modules/buildslave/manifests/startup/desktop.pp
@@ -1,15 +1,15 @@
class buildslave::startup::desktop {
include users::builder
file {
- ["$::users::builder::home/.config",
- "$::users::builder::home/.config/autostart"]:
+ ["${::users::builder::home}/.config",
+ "${::users::builder::home}/.config/autostart"]:
ensure => directory,
owner => $users::builder::username,
group => $users::builder::group;
- "$::users::builder::home/.config/autostart/gnome-terminal.desktop":
+ "${::users::builder::home}/.config/autostart/gnome-terminal.desktop":
require => File["/usr/local/bin/runslave.py"],
source => "puppet:///modules/buildslave/gnome-terminal.desktop",
owner => $users::builder::username,
group => $users::builder::group;
}
}
diff --git a/modules/packages/manifests/fonts.pp b/modules/packages/manifests/fonts.pp
index 88dd23a..35e9e7e 100644
--- a/modules/packages/manifests/fonts.pp
+++ b/modules/packages/manifests/fonts.pp
@@ -5,10 +5,16 @@ class packages::fonts {
["fonts-kacst-one", "fonts-kacst", "fonts-liberation",
"ttf-indic-fonts-core", "ttf-kannada-fonts", "ttf-dejavu",
"ttf-oriya-fonts", "ttf-punjabi-fonts", "ttf-arphic-uming",
"ttf-paktype", "fonts-stix", "fonts-unfonts-core",
"fonts-unfonts-extra"]:
ensure => latest;
}
}
+ Darwin: {
+ # Nothing to do
+ }
+ default: {
+ fail("Don't know how to install fonts on $::operatingsystem")
+ }
}
}
diff --git a/modules/packages/manifests/mercurial.pp b/modules/packages/manifests/mercurial.pp
index 4fa1cc7..c0e6be4 100644
--- a/modules/packages/manifests/mercurial.pp
+++ b/modules/packages/manifests/mercurial.pp
@@ -1,11 +1,11 @@
class packages::mercurial {
case $::operatingsystem {
- CentOS: {
+ CentOS, Ubuntu: {
package {
"mercurial":
ensure => latest;
}
}
default: {
fail("cannot install on $::operatingsystem")
}
diff --git a/modules/packages/manifests/mozilla/py27_mercurial.pp b/modules/packages/manifests/mozilla/py27_mercurial.pp
index 182104b..ab15725 100644
--- a/modules/packages/manifests/mozilla/py27_mercurial.pp
+++ b/modules/packages/manifests/mozilla/py27_mercurial.pp
@@ -1,36 +1,39 @@
class packages::mozilla::py27_mercurial {
+
+ $mercurial = "/tools/python27-mercurial/bin/hg"
+
anchor {
'packages::mozilla::py27_mercurial::begin': ;
'packages::mozilla::py27_mercurial::end': ;
}
include packages::mozilla::python27
case $::operatingsystem {
CentOS: {
- $mercurial = "/tools/python27-mercurial/bin/hg"
Anchor['packages::mozilla::py27_mercurial::begin'] ->
package {
"mozilla-python27-mercurial":
ensure => latest,
require => Class['packages::mozilla::python27'];
} -> Anchor['packages::mozilla::py27_mercurial::end']
}
Ubuntu: {
- $mercurial = "/usr/bin/hg"
- Anchor['packages::mozilla::py27_mercurial::begin'] ->
- package {
- "mercurial":
- ensure => latest;
- } -> Anchor['packages::mozilla::py27_mercurial::end']
+ include packages::mercurial
+ file {
+ ["/tools/python27-mercurial", "/tools/python27-mercurial/bin"]:
+ ensure => directory;
+ $mercurial:
+ ensure => link,
+ target => "/usr/bin/hg";
+ }
}
Darwin: {
- $mercurial = "/tools/python27-mercurial/bin/hg"
Anchor['packages::mozilla::py27_mercurial::begin'] ->
packages::pkgdmg {
python27-mercurial:
version => "2.1.1-1";
} -> Anchor['packages::mozilla::py27_mercurial::end']
}
default: {
fail("cannot install on $::operatingsystem")
diff --git a/modules/packages/manifests/mozilla/python27.pp b/modules/packages/manifests/mozilla/python27.pp
index 991574e..c716e48 100644
--- a/modules/packages/manifests/mozilla/python27.pp
+++ b/modules/packages/manifests/mozilla/python27.pp
@@ -1,38 +1,45 @@
class packages::mozilla::python27 {
+ $python = '/tools/python27/bin/python2.7'
anchor {
'packages::mozilla::python27::begin': ;
'packages::mozilla::python27::end': ;
}
case $::operatingsystem {
CentOS: {
- $python = '/tools/python27/bin/python2.7'
Anchor['packages::mozilla::python27::begin'] ->
package {
"mozilla-python27":
ensure => latest;
} -> Anchor['packages::mozilla::python27::end']
}
Ubuntu: {
- $python = '/usr/bin/python'
Anchor['packages::mozilla::python27::begin'] ->
package {
"python2.7":
ensure => latest;
} -> Anchor['packages::mozilla::python27::end']
Anchor['packages::mozilla::python27::begin'] ->
package {
"python2.7-dev":
ensure => latest;
} -> Anchor['packages::mozilla::python27::end']
+
+ # Create symlinks for compatibility with other platforms
+ file {
+ ["/tools/python27", "/tools/python27/bin"]:
+ ensure => directory;
+ [$python, "/usr/local/bin/python2.7"]:
+ ensure => link,
+ target => "/usr/bin/python";
+ }
}
Darwin: {
- $python = '/tools/python27/bin/python2.7'
Anchor['packages::mozilla::python27::begin'] ->
packages::pkgdmg {
python27:
version => "2.7.2-1";
} -> Anchor['packages::mozilla::python27::end']
}
default: {
fail("cannot install on $::operatingsystem")
diff --git a/modules/packages/manifests/puppet.pp b/modules/packages/manifests/puppet.pp
index ade3b8c..dd874b6 100644
--- a/modules/packages/manifests/puppet.pp
+++ b/modules/packages/manifests/puppet.pp
@@ -1,30 +1,32 @@
class packages::puppet {
anchor {
'packages::puppet::begin': ;
'packages::puppet::end': ;
}
$puppet_version = "2.7.17"
$puppet_rpm_version = "${puppet_version}-1.el6"
+ $puppet_deb_version = "${puppet_version}-1mozilla1"
$facter_version = "1.6.11"
case $::operatingsystem {
CentOS: {
package {
"puppet":
ensure => "$puppet_rpm_version";
# puppet this pulls the required version of facter
}
}
Ubuntu: {
package {
"puppet":
- ensure => "latest"; # TODO: need to fix the version?
+ ensure => "latest";
+ # TODO: use `ensure => $puppet_deb_version;`
}
}
Darwin: {
# These DMGs come directly from http://downloads.puppetlabs.com/mac/
Anchor['packages::puppet::begin'] ->
packages::pkgdmg {
puppet:
version => $puppet_version;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment