Andrew Bogott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59161
Change subject: Added 'pythonfile' module.
......................................................................
Added 'pythonfile' module.
For convenience, this defines a resource which is the same
as a File but which also links the installed file to
/usr/lib/python2.6/dist-packages/ or
/usr/lib/python2.7/dist-packages/ or
/usr/lib/python3/dist-packages/
depending on which python versions are present on a system.
Change-Id: Ie5ad47a0bc677798180837842222dc8db67c233e
---
A modules/pythonfile/manifests/init.pp
1 file changed, 82 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/61/59161/1
diff --git a/modules/pythonfile/manifests/init.pp
b/modules/pythonfile/manifests/init.pp
new file mode 100644
index 0000000..912fa7d
--- /dev/null
+++ b/modules/pythonfile/manifests/init.pp
@@ -0,0 +1,82 @@
+# This should behave the same as the puppet 'file' type,
+# but will also link the file to the appropriate dist-packages
+# dir, depending on the installed pythin version.
+
+define pythonfile ( backup = undef,
+ checksum = undef,
+ content = undef,
+ ctime = undef,
+ ensure = undef,
+ force = undef,
+ group = undef,
+ ignore = undef,
+ links = undef,
+ mode = undef,
+ mtime = undef,
+ owner = undef,
+ path = undef,
+ provider = undef,
+ purge = undef,
+ recurse = undef,
+ recurselimit = undef,
+ replace = undef,
+ selinux_ignore_defaults = undef,
+ selrange = undef,
+ selrole = undef,
+ seltype = undef,
+ seluser = undef,
+ source = undef,
+ sourceselect = undef,
+ target = undef,
+ type = undef ) {
+ # Do everything that 'file' would do...
+ file {
+ $name:
+ backup => $backup,
+ checksum => $checksum,
+ content => $content,
+ ctime => $ctime,
+ ensure => $ensure,
+ force => $force,
+ group => $group,
+ ignore => $ignore,
+ links => $links,
+ mode => $mode,
+ mtime => $mtime,
+ owner => $owner,
+ path => $path,
+ provider => $provider,
+ purge => $purge,
+ recurse => $recurse,
+ recurselimit => $recurselimit,
+ replace => $replace,
+ selinux_ignore_defaults => $selinux_ignore_defaults,
+ selrange => $selrange,
+ selrole => $selrole,
+ seltype => $seltype,
+ seluser => $seluser,
+ source => $source,
+ sourceselect => $sourceselect,
+ target => $target,
+ type => $type
+ }
+
+ $basename = regsubst($name, '.*/', "", "G")
+
+ # and link to all available python dirs.
+ exec { "$name-link-to-python2.6":
+ command => "/bin/ln -s $name /usr/lib/python2.6/dist-packages/$basename",
+ creates => "/usr/lib/python2.6/dist-packages/$basename",
+ onlyif => "/usr/bin/test -d /usr/lib/python2.6/dist-packages";
+ }
+ exec { "$name-link-to-python2.7":
+ command => "/bin/ln -s $name /usr/lib/python2.7/dist-packages/$basename",
+ creates => "/usr/lib/python2.7/dist-packages/$basename",
+ onlyif => "/usr/bin/test -d /usr/lib/python2.7/dist-packages";
+ }
+ exec { "$name-link-to-python3.0":
+ command => "/bin/ln -s $name /usr/lib/python3/dist-packages/$basename",
+ creates => "/usr/lib/python3/dist-packages/$basename",
+ onlyif => "/usr/bin/test -d /usr/lib/python3/dist-packages";
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/59161
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5ad47a0bc677798180837842222dc8db67c233e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits