Skip to content

Instantly share code, notes, and snippets.

################################################################################
#
# Administers version control (Subversion) for Cfengine 3
#
################################################################################
bundle agent cfgMgtVcs {
vars:
################################################################################
#
# Administers version control (Subversion) for Cfengine 3
#
################################################################################
bundle agent cfgMgtVcs {
vars:
################################################################################
#
# Administers version control (Subversion) for Cfengine 3
#
################################################################################
# If it does not exist, create an SVN repository $(repo) at $(path) as user
# $(user), and set up base dirs branches,tags,trunk.
bundle agent initializeSvnRepo(repo, path, user) {
body volume checksize(size)
{
sensible_size => "$(size)";
}
<snip from bundle agent>
storage:
bundle agent chkconfig_on(foo) {
classes:
"service_is_enabled" expression => returnszero("/usr/bin/chkconfig --level 3 $(foo)");
commands:
!service_is_enabled::
#$Id$
################################################################################
#
# Set up clients to mount NFS shares on the filer with autofs
#
# NOTE: the cf2 version of nfsClient drove, with a file copy, the configuration
# of the nic for the storage network. Leaving that out now, since
# a) we should make that configuration reusable (the need for secondary nic
# management is broader than nfsClient);
@jlgreer
jlgreer / chkconfig_tests.txt
Created April 19, 2011 16:27
Chkconfig tests to add to the methods: section of a policy file (I used nfsClient.cf)
methods:
andwife::
# TESTING
#"chkconfig_add_jgtest"
# usebundle => chkconfig_add("jgtest");
#"chkconfig_on_jgtest"
# usebundle => chkconfig_on("jgtest");
#"chkconfig_off_jgtest"
@jlgreer
jlgreer / jgtest.txt
Created April 19, 2011 16:28
Init script for chkconfig tests
[root@annyong init.d]# cat jgtest
#!/bin/sh
# chkconfig: 2345 55 25
# description: Sendmail
# This file is under cfengine control. It lives on mrfrumble.
case "$1" in
start)
echo "Starting jgtest"
;;
@jlgreer
jlgreer / users_cf_diff.txt
Created May 3, 2011 00:03
Diff of users.cf
$ diff -C3 /var/cfengine/masterfiles/inputs/dcsunix/users.cf ./
*** /var/cfengine/masterfiles/inputs/dcsunix/users.cf 2011-04-19 15:26:35.000000000 -0400
--- ./users.cf 2011-05-02 15:21:53.000000000 -0400
***************
*** 17,23 ****
"dcsunixStaff" slist => { "@(var.dcsunixStaff)" };
vm_cfgprdapp_01::
! "users" slist => { "@(dcsunixStaff)", "unixsys" };
# The cfsync user also needs to be in dcsunix, so we can automate syncing v2
@jlgreer
jlgreer / cfengine_cf_diff.txt
Created May 3, 2011 00:10
Diff of cfengine.cf
$ diff -C3 /var/cfengine/masterfiles/inputs/dcsunix/users.cf ./
*** /var/cfengine/masterfiles/inputs/dcsunix/users.cf 2011-04-19 15:26:35.000000000 -0400
--- ./users.cf 2011-05-02 15:21:53.000000000 -0400
***************
*** 17,23 ****
"dcsunixStaff" slist => { "@(var.dcsunixStaff)" };
vm_cfgprdapp_01::
! "users" slist => { "@(dcsunixStaff)", "unixsys" };
# The cfsync user also needs to be in dcsunix, so we can automate syncing v2