Skip to content

Slaffcheff's place

System administration / DevOps / Life

  • About

Tag: python

Automate installing pip3 packages on older puppet versions.

Posted on October 10, 2017 - April 2, 2018 by Rosen Slavchev

Recently, I had to install Python library for scientific computing. R&D team needed it so I took care. But as ALWAYS I hit a brick wall. I had to make new puppet node for a specific node and automate these packages up to date / installed. Of course, my puppet server is with older version than required from Scipy for the pip3 provider. So, I had to do it the hard way using “exec”. Here is the Python solution of my nightmares:

if ($need_to_install == undef ) {
exec { 'install python packages':
command => 'pip3 install setuptools mysqlclient numpy scipy scikit-learn; touch /root/installed_pip3.txt',
path => ['/usr/bin/'],
before => Exec['create custom facter'],
}
exec { 'create custom facter':
command => "mkdir -p /etc/facter/facts.d; echo 'need_to_install=false' > /etc/facter/facts.d/check_pip_install.txt",
provider => shell,
}
}

Posted in AutomationTagged pip3, puppet, python

Recent Posts

  • Segmentation fault on openSUSE Leap 15.0
  • Подпишете петицията ПРОТИВ чл. 13.
  • Free image stock and graphical resources
  • Българският mirror на openSUSE
  • openSUSE в България с 2 събитие за този месец!

Archives

  • October 2019
  • November 2018
  • June 2018
  • April 2018
  • March 2018
  • January 2018
  • October 2017
  • August 2017
  • July 2017
  • July 2016
  • September 2015
  • August 2015
  • March 2015
  • February 2015

Categories

  • Automation
  • Cyber security
  • Hacking
  • Linux
  • MySQL
  • openSUSE
  • Phrack
  • Quicks
  • Scripting
  • Uncategorized
  • Up to date
  • Web Freedom
  • Windows Server
Proudly powered by WordPress | Theme: micro, developed by DevriX.