Skip to content

Instantly share code, notes, and snippets.

@omarqureshi
Created December 16, 2013 13:38
Show Gist options
  • Save omarqureshi/7987031 to your computer and use it in GitHub Desktop.
Save omarqureshi/7987031 to your computer and use it in GitHub Desktop.
node "rackspace-database" inherits base {
exec{"create-fs":
command => "mkfs -t ext3 /dev/xvde1",
user => 'root',
path => ['/usr/bin','/sbin'],
timeout => 0,
unless => "/usr/bin/file -s /dev/xvde1 | /bin/grep ext3",
}
file {"/var/lib/postgresql":
ensure => "directory",
require => Exec["create-fs"],
}
mount { "/var/lib/postgresql":
ensure => 'present',
device => "/dev/xvde1",
fstype => "ext3",
options => 'defaults',
atboot => 'true',
require => File["/var/lib/postgresql"],
}
exec{"mount-fs":
command => "mount /dev/xvde1 /var/lib/postgresql",
user => 'root',
path => ['/usr/bin','/bin'],
require => Mount["/var/lib/postgresql"],
unless => "df | grep /var/lib/postgresql"
}
}
node "database-node-name" inherits "rackspace-database" {
class { 'postgresql::globals':
manage_package_repo => true,
version => '9.2',
require => Exec["mount-fs"],
}->
class {'postgresql::server':
}
include postgresql::lib::devel
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment