Skip to content

Instantly share code, notes, and snippets.

@jrmoserbaltimore
Created February 4, 2013 21:03
Show Gist options
  • Save jrmoserbaltimore/4709697 to your computer and use it in GitHub Desktop.
Save jrmoserbaltimore/4709697 to your computer and use it in GitHub Desktop.
class pacemaker::config::crm {
$crm_config = $pacemaker::crm_config
$crm_hash = $pacemaker::crm_hash
exec { 'dump crm config':
command => 'crm configure save /etc/corosync/config.crm',
onlyif => 'rm -f /etc/corosync/config.crm',
path => '/bin:/sbin:/usr/bin:/usr/sbin',
tag => 'pre-crm',
}
file { '/etc/corosync/config.crm':
content => template($crm_config),
owner => 'root',
group => 'root',
mode => '0644',
tag => 'crm',
}
exec { 'load crm config':
command => 'crm configure load replace /etc/corosync/config.crm',
onlyif => 'crm configure property stop-all-resources=true',
path => '/bin:/sbin:/usr/bin:/usr/sbin',
refreshonly => true,
tag => 'post-crm',
}
Package <| tag == 'pacemaker' |> ->
Exec <| tag == 'prepare-crm' |> ->
Exec <| tag == 'pre-crm' |> ->
File <| tag == 'crm' |> ~>
Exec <| tag == 'post-crm' |>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment