Hi Gary can i set environment in package for /usr/bin ??
On Fri, Apr 22, 2016 at 11:59 AM, Gary Greene <[email protected]> wrote: > > > On Apr 22, 2016, at 11:04 AM, [email protected] wrote: > > Hi all, > > I am trying to manage python packages from puppet.I wanted to run the > following commands *without using EXEC..* > > *After installing python-setuptools i tried to install pika using pip as > provider .. but it did not work.* > > *What is the best way to puppetize this??* > > *Thank You* > *Bapi* > > > > > > > > *sudo yum install python-setuptoolssudo easy-install pipsudo easy-install > argparsesudo /usr/bin/pip install pika* > > > Since puppet runs as root, generally, you wouldn’t need the sudo for these > commands. > > Note, I’m not a python guy, so testing for the install of these may or may > not work this way, since if these eggs are apps, they’ll likely not have > modules with the same name as the driver script... > > Anyway, back to your question, if I were doing this, and couldn’t use the > number of existing options on the forge for whatever reason, I’d do > something like this: > > --- puppet code --- > > # should really get this from some other source instead of hard-coding > it... > PYTHON_PREFIX = “/usr" > > # same for the package name. > package { “python-setuptools”: > ensure => installed, > provider => yum > } > > exec { “pip_install”: > command => “$PYTHON_PREFIX/bin/easy-install pip”, > require => Package[ ‘python-setuptools’, > unless => “test -x /usr/bin/pip" > } > > exec { “argparse_install": > command => “$PYTHON_PREFIX/bin/easy-install argparse”, > require => Exec[ ‘pip_install’ ], > unless => 'python -c “import argparse” &> /dev/null' > } > > exec { “pika_install”: > command => “$PYTHON_PREFIX/bin/pip install pika”, > require => Exec[ ‘pip_install’ ], > unless => 'python -c “import pika” &> /dev/null' > } > > --- end of puppet code --- > > Note that these kinds of chains can be fragile if not tested well for your > environment. > > -- > Gary L. Greene, Jr. > > ============================================================================== > Volunteer developer of the KDE F/OSS project and Project Lead for AltimatOS > http://www.kde.org/ http://www.altimatos.com/ > > ============================================================================== > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Puppet Users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/puppet-users/55S_4ON7N6g/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/F8A2A601-6964-4E23-B237-72ACE1902F55%40tolharadys.net > <https://groups.google.com/d/msgid/puppet-users/F8A2A601-6964-4E23-B237-72ACE1902F55%40tolharadys.net?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CANW71sQ-ghZNd3AiHjE5AoDE7Ti7mw7j2eS4YZncFhQMpctOdA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
