Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

1.0.0 - 20110405 - initial release

  • Loading branch information...
commit 45f509df027b1ca6a9685e2884c5189a46e797d8 0 parents
ghoneycutt authored
2  CHANGELOG
@@ -0,0 +1,2 @@
+1.0.0 - 20110405
+ * initial release
17 LICENSE
@@ -0,0 +1,17 @@
+ldconfig Puppet Module. Copyright (C) 2011 Puppet Labs, Inc.
+
+Garrett Honeycutt can be contacted at: contact@garretthoneycutt.com.
+
+This program and entire repository is free software; you can
+redistribute it and/or modify it under the terms of the GNU
+General Public License version 2 as published by the Free Software
+Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3  README
@@ -0,0 +1,3 @@
+ldconfig
+
+Tested on RHEL6
10 TODO
@@ -0,0 +1,10 @@
+* ensure consistency with style guide
+
+* add documentation
+ * README
+ * correct code comments
+
+* create metadata
+ * publish on forge
+
+* Check that it works with other systems that utilize ldconfig
47 manifests/conf_snippet.pp
@@ -0,0 +1,47 @@
+define ldconfig::conf_snippet (
+ $ensure = 'present',
+ $content = '',
+ $source = '',
+ $filename = ''
+) {
+
+ $Realname = $filename ? {
+ '' => $name,
+ default => $filename
+ } # $Realname
+
+ case $ensure {
+ present: {
+ case $content {
+ '': {
+ # no content means we grab a file
+ $Realsource = $source ? {
+ '' => "puppet:///modules/ldconfig/$Realname.conf",
+ default => $source
+ } # $Realsource
+ file { "$ldconfig::basedir/$Realname.conf":
+ ensure => present,
+ source => "$Realsource",
+ require => Package['ldconfigPackage'],
+ notify => Exec['ldconfig-rebuild'],
+ } # file
+ } # '':
+ default: {
+ # use a template to generate the content
+ file { "$ldconfig::basedir/$Realname.conf":
+ ensure => present,
+ content => $content,
+ require => Package['ldconfigPackage'],
+ notify => Exec['ldconfig-rebuild'],
+ } # file
+ } # default:
+ } # case $content
+ } # present:
+ absent: {
+ file { "$ldconfig::basedir/$Realname.conf":
+ ensure => absent,
+ notify => Exec['ldconfig-rebuild'],
+ } # file
+ } # absent:
+ } # case $ensure
+} # define ldconfig::conf_snippet
22 manifests/init.pp
@@ -0,0 +1,22 @@
+# ldconfig
+#
+# manage ldconfig config files
+#
+# garrett honeycutt - garrett@puppetlabs.com - 20110405
+#
+class ldconfig {
+
+ # default directory for snippets
+ $basedir = '/etc/ld.so.conf.d'
+
+ package { 'glibc':
+ ensure => installed,
+ alias => 'ldconfigPackage',
+ } # package
+
+ exec { 'ldconfig-rebuild':
+ refreshonly => true,
+ path => '/sbin',
+ command => '/sbin/ldconfig',
+ } # exec
+} # class ldconfig
13 manifests/snippet.pp
@@ -0,0 +1,13 @@
+define ldconfig::snippet (
+ $ensure = 'present',
+ $content = '',
+ $source = ''
+) {
+ ldconfig::conf_snippet { "snippet-$name":
+ ensure => $ensure,
+ content => $content,
+ source => $source,
+ filename => $name,
+ require => Package['ldconfigPackage'],
+ } # ldconfig::conf_snippet
+} # define ldconfig::snippet
Please sign in to comment.
Something went wrong with that request. Please try again.