{"id":58,"date":"2008-02-01T16:15:52","date_gmt":"2008-02-01T21:15:52","guid":{"rendered":"http:\/\/blogs.cae.tntech.edu\/mwr\/2008\/02\/01\/the-autostow-is-dead-long-live-stowedpackage\/"},"modified":"2024-10-27T14:26:19","modified_gmt":"2024-10-27T14:26:19","slug":"the-autostow-is-dead-long-live-stowedpackage","status":"publish","type":"post","link":"https:\/\/sites.tntech.edu\/renfro\/2008\/02\/01\/the-autostow-is-dead-long-live-stowedpackage\/","title":{"rendered":"The autostow is Dead, Long Live stowedpackage!"},"content":{"rendered":"<p><a href=\"http:\/\/blogs.cae.tntech.edu\/mwr\/2007\/05\/19\/client-application-management-part-2-for-stow-packages\/\">I had posted earlier<\/a> about distributing stowed packages via rsync and puppet to my managed systems, but that method wasn&#8217;t quite what I wanted:<\/p>\n<ol>\n<li>There was one more file to manage outside my regular puppet manifests, and I&#8217;d have to remember to keep them both up to date and in sync.<\/li>\n<li>There wasn&#8217;t an easy way of ensuring that other versions of a particular package got unstowed before deploying out the desired version.<\/li>\n<li>The entire stow tree would be copied out to every system, regardless of whether OpenMPI was a good fit for the web server.<\/li>\n<\/ol>\n<p>So, here&#8217;s my new method:<\/p>\n<ol>\n<li>Keep my same metastow module loaded on the rsync server. The metastow module contains one top-level directory per puppet architecture (i686, x86_64, etc.). Each of those architecture folders is a stow tree containing every stowed package for that architecture.<\/li>\n<li>Add a stowedpackage definition to my puppet manifests as follows:\n<pre>\ndefine stowedpackage ( $basepackage, $version,\n    $rsyncserver='gold.cae.tntech.edu',\n    $rsyncmodule='metastow',\n    $stowdestdir='\/usr\/local\/stow' ) {\n    file { \"stow-initiator_${basepackage}-${version}\":\n        source =&gt; \"puppet:\/\/\/files\/stow-initiator_${basepackage}-${version}\",\n        path   =&gt; \"\/etc\/puppet\/stow-initiator_${basepackage}-${version}\",\n    }\n    exec { download:\n        command     =&gt; \"\/usr\/bin\/rsync -a --delete ${rsyncserver}::${rsyncmodule}\/${hardwaremodel}\/${basepackage}-${version} ${stowdestdir}\",\n        refreshonly =&gt; true,\n        subscribe   =&gt; File[\"stow-initiator_${basepackage}-${version}\"],\n        alias       =&gt; \"download_${basepackage}-${version}\"\n    }\n    exec { unstow-others:\n        command     =&gt; \"cd ${stowdestdir} &amp;&amp; stow --delete ${basepackage}-*\",\n        refreshonly =&gt; true,\n        subscribe   =&gt; Exec[\"download_${basepackage}-${version}\"],\n        alias       =&gt; \"unstow-others_${basepackage}-${version}\"\n    }\n    exec { stow:\n        command     =&gt; \"cd ${stowdestdir} ; stow ${basepackage}-${version}\",\n        refreshonly =&gt; true,\n        subscribe   =&gt; Exec[\"unstow-others_${basepackage}-${version}\"]\n    }\n}\n<\/pre>\n<\/li>\n<li>Use the stowedpackage definition in other parts of my manifests:\n<pre>\n# Create OpenMPI installation and configuration.\nclass openmpi {\n\n    stowedpackage {\n        \"openmpi-1.0.1\":\n            basepackage=&gt;\"openmpi\",\n            version=&gt;\"1.0.1\";\n    }\n\n}\n<\/pre>\n<\/li>\n<li>Add a trigger file to the puppetmaster&#8217;s \/etc\/puppet\/files folder:\n<pre>\n\/etc\/puppet\/files# date &gt; stow-initiator_openmpi-1.0.1\n<\/pre>\n<\/li>\n","protected":false},"excerpt":{"rendered":"<p>I had posted earlier about distributing stowed packages via rsync and puppet to my managed systems, but that method wasn&#8217;t quite what I wanted: There was one more file to manage outside my regular puppet manifests, and I&#8217;d have to remember to keep them both up to date and in sync. There wasn&#8217;t an easy &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/sites.tntech.edu\/renfro\/2008\/02\/01\/the-autostow-is-dead-long-live-stowedpackage\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;The autostow is Dead, Long Live stowedpackage!&#8221;<\/span><\/a><\/p>\n","protected":false},"author":87,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,16],"tags":[],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-infrastructures","category-puppet","entry"],"_links":{"self":[{"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":1,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":474,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/posts\/58\/revisions\/474"}],"wp:attachment":[{"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}