File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Make pip version available as a fact
22# Works with pip loaded and without, pip installed using pip and package installed
33require 'puppet'
4- pkg = Puppet ::Type . type ( :package ) . new ( :name => "python-pip" )
4+ if Gem ::Version . new ( Facter . value ( :puppetversion ) ) >= Gem ::Version . new ( '3.6' )
5+ pkg = Puppet ::Type . type ( :package ) . new ( :name => 'python-pip' , :allow_virtual => 'false' )
6+ else
7+ pkg = Puppet ::Type . type ( :package ) . new ( :name => 'python-pip' )
8+ end
59Facter . add ( "pip_version" ) do
610 has_weight 100
711 setcode do
Original file line number Diff line number Diff line change 11# Make python versions available as facts
22# In lists default python and system python versions
33require 'puppet'
4- pkg = Puppet ::Type . type ( :package ) . new ( :name => "python" )
5-
4+ if Gem ::Version . new ( Facter . value ( :puppetversion ) ) >= Gem ::Version . new ( '3.6' )
5+ pkg = Puppet ::Type . type ( :package ) . new ( :name => 'python' , :allow_virtual => 'false' )
6+ else
7+ pkg = Puppet ::Type . type ( :package ) . new ( :name => 'python' )
8+ end
69Facter . add ( "system_python_version" ) do
710 setcode do
811 begin
Original file line number Diff line number Diff line change 11# Make virtualenv version available as a fact
22# Works with virualenv loaded and without, pip installed and package installed
33require 'puppet'
4- pkg = Puppet ::Type . type ( :package ) . new ( :name => "virtualenv" )
4+ if Gem ::Version . new ( Facter . value ( :puppetversion ) ) >= Gem ::Version . new ( '3.6' )
5+ pkg = Puppet ::Type . type ( :package ) . new ( :name => 'virtualenv' , :allow_virtual => 'false' )
6+ else
7+ pkg = Puppet ::Type . type ( :package ) . new ( :name => 'virtualenv' )
8+ end
59Facter . add ( "virtualenv_version" ) do
610 has_weight 100
711 setcode do
You can’t perform that action at this time.
0 commit comments