puppet只在第一次运行时使用pip3提供程序安装pip而不是pip3包

时间:2017-06-08 15:23:17

标签: python python-3.x pip puppet

鉴于已经在机器中安装了pyton3和pip3,我正在声明boto3包,如下所示:

  package { 'boto3':
    ensure => present,
    provider => 'pip3',
  }

问题在于,当你第一次运行木偶时,你会得到:

{"level":"debug","message":"Executing '/bin/pip3 freeze'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:22:58.058603923+
00:00"}
{"level":"debug","message":"Executing '/bin/pip3 --version'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:22:58.7344189
24+00:00"}
{"level":"debug","message":"Executing '/bin/pip3 freeze'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:22:59.317146692+
00:00"}
{"level":"debug","message":"Executing '/bin/pip3 --version'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:22:59.9823109
65+00:00"}
{"level":"debug","message":"Executing: '/bin/pip install -q boto3'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:23:00.569312158+00:00"}

当你第二次按预期运行时运行它:

{"level":"debug","message":"Executing '/bin/pip3 freeze'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:39:50.080139315+
00:00"}
{"level":"debug","message":"Executing '/bin/pip3 --version'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:39:50.7515434
28+00:00"}
{"level":"debug","message":"Executing '/bin/pip3 freeze'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:39:51.332423254+
00:00"}
{"level":"debug","message":"Executing '/bin/pip3 --version'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:39:51.9972545
96+00:00"}
{"level":"debug","message":"Executing: '/bin/pip3 install -q boto3'","source":"Puppet","tags":["debug"],"file":null,"line":null,"version":1,"@timestamp":"2017-06-08T14:39:52.586167287+00:00"}

上述情况发生在木偶运行之间的环境中根本没有做任何改变。

罪魁祸首必须在 https://github.com/puppetlabs/puppet/blob/4.10.1/lib/puppet/provider/package/pip3.rb   基本上导入https://github.com/puppetlabs/puppet/blob/4.10.1/lib/puppet/provider/package/pip.rb

我想提交一个错误,但我无法弄清楚发生了什么 我在我用来启动服务器的图像上预先支持boto3。 我正在使用Puppet 4.10.1并且我在服务器中本地(无主)运行puppet apply

0 个答案:

没有答案