Permalink
Browse files

Added required Augeas lenses

  • Loading branch information...
1 parent 7222400 commit cd24f256f4d186946c4e26e0443b6691e598877c @rodjek committed Feb 2, 2010
Showing with 69 additions and 10 deletions.
  1. +25 −0 files/usr/share/augeas/lenses/haauthkeys.aug
  2. +26 −0 files/usr/share/augeas/lenses/hacf.aug
  3. +18 −10 manifests/init.pp
@@ -0,0 +1,25 @@
+module Haauthkeys =
+
+autoload xfm
+
+let eol = Util.eol
+let comment = Util.comment
+let empty = Util.empty
+let ws = Util.del_ws " "
+let num = /[0-9]+/
+let method = /(md5|sha1|crc)/
+let key_str = /[^ \t\n]+/
+
+let auth_selection = [ label "auth" . Util.del_str "auth" . ws . store num . eol ]
+
+let auth_method = [ key num . ws
+ . [ label "method" . store method ]
+ . (ws . [ label "key" . store key_str ])?
+ . eol ]
+
+let lns = (comment|empty|auth_selection|auth_method) *
+
+let filter = incl "/etc/ha.d/authkeys"
+ . Util.stdexcl
+
+let xfm = transform lns filter
@@ -0,0 +1,26 @@
+module Hacf =
+ autoload xfm
+
+ let entry = Spacevars.entry
+ let generic_entry_key = Spacevars.entry_re - /mcast/
+ let ws = Util.del_ws_spc
+ let eol = Util.eol
+ let comment = Util.comment
+ let empty = Util.empty
+
+ let generic_entry = entry generic_entry_key
+ let mcast_entry = [ label "mcast" . Util.del_str "mcast" . ws
+ . [ label "interface" . store /[a-zA-Z0-9\.]+/ ] . ws
+ . [ label "group" . store /[0-9\.]+/ ] . ws
+ . [ label "port" . store /[0-9]+/ ] . ws
+ . [ label "ttl" . store /[0-9]+/ ] . ws
+ . Util.del_str "0" . eol
+ ]
+
+ let lns = (comment|empty|mcast_entry|generic_entry)*
+
+ let filter = Util.stdexcl
+ . incl "/etc/ha.d/ha.cf"
+
+ let xfm = transform lns filter
+
View
@@ -29,7 +29,7 @@
5: {
package {
"pacemaker":
- ensure => "1.0.4-23.1",
+ ensure => "1.0.4-23.1",
require => Package["heartbeat"];
"heartbeat":
ensure => "2.99.2-8.1";
@@ -40,7 +40,7 @@
Debian,Ubuntu: {
package {
"pacemaker":
- ensure => "1.0.4-1.1anchor",
+ ensure => "1.0.4-1.1anchor",
require => Package["heartbeat"];
"heartbeat":
ensure => "2.99.2+sles11r9-1.1anchor";
@@ -74,21 +74,29 @@
file {
"/etc/ha.d/authkeys":
ensure => present,
- mode => 0600;
+ mode => 0600;
# logd config, it's very simple and can be the same everywhere
"/etc/logd.cf":
ensure => present,
- mode => 0440,
- owner => root,
- group => root,
+ mode => 0440,
+ owner => "root",
+ group => "root",
source => "puppet:///ha/etc/logd.cf";
- "/usr/local/bin/is_ha_master":
- source => "puppet:///ha/usr/local/bin/is_ha_master",
+
+ # Augeas lenses
+ "/usr/share/augeas/lenses/hacf.aug":
+ ensure => present,
+ mode => 0444,
owner => "root",
group => "root",
- mode => 0700,
- ensure => present;
+ source => "puppet:///ha/usr/share/augeas/lenses/hacf.aug";
+ "/usr/share/augeas/lenses/haauthkeys.aug":
+ ensure => present,
+ mode => 0444,
+ owner => "root",
+ group => "root",
+ source => "puppet:///ha/usr/share/augeas/lenses/haauthkeys.aug";
}
augeas {

0 comments on commit cd24f25

Please sign in to comment.