Lior Gradstein’s Blog

Archive for the ‘ruby’ Category

Synchronization methods of a file with Puppet

Usually, to synchronize a file with remote hosts, using puppet, one would use the following pattern:

file { "/etc/init.d/pvfs2-server":
      owner => root, group => root,
      mode => 755,
      source => "puppet:///files/pvfs2-server"    
}

(using “source” to copy data as-is, and using “template(“filename”) to use a template structure as data).

Or, if one wishes to directly set the content of the target file:

file { "/etc/init.d/pvfs2-server":
   owner => root, group => root,
   mode => 755,
   source => "puppet:///files/pvfs2-server"    
}

Please note that on the first line, for example ‘file { “/etc/mpd.conf”:’), the “/etc/mpd.conf” is a merge of two functionalities/concepts: Usually, the syntax is clear and simple:

file { mon_fichier_mpd_conf:
     path => "/etc/mpd.conf",
     []
}

The first line is about the resource description. Its goal is to be able to reference to it a little later from another resources (Notify[], etc.). By putting directly the file path and name (I think it’s identified as a filename and not as a description because there are quotes, or maybe it’s because it begins with a slash?) you mege the “path” attribute with its description.
On the other end, we’ll not be able to reference to it later, if you need to.

You may also need to synchronize a file that is not present in the repository (puppet:///files/*). That usually happens, for example, when that file is regenerated by an external program or an external action (like /etc/passwd).

file {"/etc/passwd":
     owner => root, group => root, mode => 644,
     content => file("/etc/passwd")
}

  • 0 Comments
  • Filed under: puppet, ruby, software
  • I found a nicely written article about the problems with Ruby, written by a Ruby user, and why he found Python to be really good. There’s even a quote about Twisted!

    And, there are a bunch of things available to a Python guy that Ruby just can’t compete with that are of particular interest to me. Two that come to mind immediately are Twisted and Stackless Python. The former was used by others at TurnTide for creating a really powerful SMTP testing tool and the latter was used by TurnTide’s competitor IronPort to build one of the industry’s best MTAs.

    I didn’t knew that IronPort was done in Python, even in Stackless Python!

  • 0 Comments
  • Filed under: python, ruby, twisted
  • Photos of Ido and Oren

    2009-11-22 14.53.56.jpg2009-11-22 14.53.40.jpg2009-11-22 14.33.25.jpg2009-11-22 14.33.14.jpg2009-11-22 14.30.32.jpg2009-11-22 14.28.49.jpg2009-11-22 14.05.22.jpg2009-11-22 14.05.12.jpg2009-11-22 14.05.07.jpg

    Search engine optimization by SEO Design Solutions