Re: [Puppet Users] PDK on bionic Ubuntu

2019-01-28 Thread Peter Berghold
David,

Removing ~/.pdk did the job.  I had already tried removing Gemfile.lock
thinking that was the issue.

Works good now. thanks


On Mon, Jan 28, 2019 at 10:53 AM David Schmitt 
wrote:

> This Gemfile works on my debian machine, which means we can exclude a
> whole bunch of potential problems. As next step, try removing your
> `Gemfile.lock` and the `/home/peter/.pdk/cache/ruby/` directory.
>
> I hope that helps.
>
> Cheers, David
>
> unrelated PS: the changes you made to require hiera 3.5.0 in the Gemfile
> do not work. It still pulls in version 3.4.5.13. I've created
> https://github.com/puppetlabs/pdk-templates/issues/182 to ask for
> allowing this to be overridden through the regular channels. At the same
> time, I'd also caution against modifying these bits too radically, as the
> PDK chooses the versions that we ship in the puppet-agent package, so
> changing that around will invalidate your test results.
>
>
> On Mon, Jan 28, 2019 at 3:21 PM Peter Berghold 
> wrote:
>
>> Gemfile
>> source ENV['GEM_SOURCE'] || 'https://rubygems.org'
>>
>> def location_for(place_or_version, fake_version = nil)
>>   git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?}
>>   file_url_regex = %r{\Afile:\/\/(?.*)}
>>
>>   if place_or_version && (git_url = place_or_version.match(git_url_regex))
>> [fake_version, { git: git_url[:url], branch: git_url[:branch],
>> require: false }].compact
>>   elsif place_or_version && (file_url =
>> place_or_version.match(file_url_regex))
>> ['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
>>   else
>> [place_or_version, { require: false }]
>>   end
>> end
>>
>> ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
>> minor_version = ruby_version_segments[0..1].join('.')
>>
>> group :development do
>>   gem "fast_gettext", '1.1.0', require: false if
>> Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
>>   gem "fast_gettext",  require: false if
>> Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
>>   gem "json_pure", '<= 2.0.1', require: false if
>> Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
>>   gem "json", '= 1.8.1',   require: false if
>> Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
>>   gem "json", '<= 2.0.4',  require: false if
>> Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
>>   gem "puppet-module-posix-default-r#{minor_version}", require: false,
>> platforms: [:ruby]
>>   gem "puppet-module-posix-dev-r#{minor_version}", require: false,
>> platforms: [:ruby]
>>   gem "puppet-module-win-default-r#{minor_version}",   require: false,
>> platforms: [:mswin, :mingw, :x64_mingw]
>>   gem "puppet-module-win-dev-r#{minor_version}",   require: false,
>> platforms: [:mswin, :mingw, :x64_mingw]
>> end
>>
>> puppet_version = ENV['PUPPET_GEM_VERSION']
>> facter_version = ENV['FACTER_GEM_VERSION']
>> hiera_version = ENV['3.5.0']
>>
>>
>> gems = {}
>>
>> gems['puppet'] = location_for(puppet_version)
>>
>> # If facter or hiera versions have been specified via the environment
>> # variables
>>
>> gems['facter'] = location_for(facter_version) if facter_version
>> gems['hiera'] = location_for('3.5.1') if hiera_version
>>
>> if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
>>   # If we're using a Puppet gem on Windows which handles its own
>> win32-xxx gem
>>   # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
>>   gems['win32-dir'] =  ['<= 0.4.9', require: false]
>>   gems['win32-eventlog'] = ['<= 0.6.5', require: false]
>>   gems['win32-process'] =  ['<= 0.7.5', require: false]
>>   gems['win32-security'] = ['<= 0.2.5', require: false]
>>   gems['win32-service'] =  ['0.8.8', require: false]
>> end
>>
>> gems.each do |gem_name, gem_params|
>>   gem gem_name, *gem_params
>> end
>>
>> # Evaluate Gemfile.local and ~/.gemfile if they exist
>> extra_gemfiles = [
>>   "#{__FILE__}.local",
>>   File.join(Dir.home, '.gemfile'),
>> ]
>>
>> extra_gemfiles.each do |gemfile|
>>   if File.file?(gemfile) && File.readable?(gemfile)
>> eval(File.read(gemfile), binding)
>>   end
>> end
>> # vim: syntax=ruby
>>
>>
>> On Mon, Jan 28, 2019 at 10:19 AM David Schmitt 
>> wrote:
>>
>>> please also provide the Gemfile as I've asked above. Without that it's
>>> impossible to reproduce locally and/or diagnose.
>>>
>>>
>>>
>>> On Mon, Jan 28, 2019 at 3:03 PM Peter Berghold 
>>> wrote:
>>>
 Yes that was done in a module created by PDK originally.

 Here is the debug output

 peter@saltycowdawg: mediawiki]:(master): pdk test unit --debug
 pdk (INFO): Using Ruby 2.5.1
 pdk (INFO): Using Puppet 6.0.2
 pdk (DEBUG): Checking for missing Gemfile dependencies.
 pdk (DEBUG): Using '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle'
 from PDK package.
 pdk (DEBUG): Executing

[Puppet Users] ensure_packets not working

2019-01-28 Thread Jochen Haeberle
Hi,

I am using serverless puppet apply on some nodes. I prepared a set of manifests 
using forge plugins. I developed everything using Vagrant quite fine.

Now I put my code via git on a debian 9.7 VM with puppet 6.2 and am getting the 
following errors:

Error: Evaluation Error: Error while evaluating a Function Call, Duplicate 
declaration: Package[libapache2-mod-php7.3] is already declared at (file: 
/etc/puppetlabs/code/environments/production/modules/profile/manifests/software/apache.pp,
 line: 78); cannot redeclare (file: 
/etc/puppetlabs/code/environments/production/modules/profile/manifests/software/wordpress.pp,
 line: 24) (file: 
/etc/puppetlabs/code/environments/production/modules/profile/manifests/software/wordpress.pp,
 line: 24, column: 3)

Both instances use the stdlib function ensure_packages. If I remove one of the 
instances, I will get the error with another package.

puppetlabs/stdlib and all other modules are up to date, thanks to r10k, Code is 
working on a fresh vagrant machine.

What can be the culprit of this? I have no idea where to look for this problem.

Thanks in advance vor any hints, regards

Jochen

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1FF3C627-8E25-44EE-B188-5C23C3887BB1%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to compare two strings/Arrays

2019-01-28 Thread Abhishek singh
Hello Group,

I am trying to use facts like interfaces and based on the available 
interfaces perform  a common task.

Please help me out for below:

1. How  strings from core facts and local variable can be compared?

For example if interfaces has "eth0, lo, .." and i want to match from it.


1. if ('lo' in $facts['interfaces']) # it is not working but also no 
validation error.



2.if  ! ($facts['interfaces'] in [ 'lo', 'ens160' ])   # it is not 
working but also no validation error.
   

is it possible to put a condition on facts existence itself? 

like if ipaddress_eth0 is then perform action from code/enter in loop.


Please help me out.
Also, Please suggest any links for future understanding.

Thanks.

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/32b533b0-648c-4f04-b70a-880f3df91668%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: TrustedInformation expected a certificate - issue

2019-01-28 Thread Tibor Ölvedi
Hi Ren,

I see the same message on my setup (incl. a reverse proxy responsible for 
external ssl termination) as well.
I'd assume that means, that puppetserver couldn't authenticate the client, 
it just assumes the client's identity by the header "X-Client-DN" recieved 
from the authenticating proxy.

Cheers

2017. október 10., kedd 14:53:53 UTC+2 időpontban Ren a következőt írta:
>
> Hello everyone. 
>
> my infra is working with puppet v.4 . I have separated the CA ,  
> puppetmaster and puppetdb  and   all is wokring perfectly fine. 
>
> One small exception is : the puppetmaster is loging with message like : 
>
> [puppetserver] Puppet TrustedInformation expected a certificate, but none 
> was given.
>
> Any Idea why this message , 
>  since that I am able to sign client . 
> there is no critical error message on all servers. 
>
> many thanks for the supprt. 
>
> Cheers, 
> ren
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/379bfbad-06db-407d-9cca-d5cc668d7a53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PDK on bionic Ubuntu

2019-01-28 Thread David Schmitt
This Gemfile works on my debian machine, which means we can exclude a whole
bunch of potential problems. As next step, try removing your `Gemfile.lock`
and the `/home/peter/.pdk/cache/ruby/` directory.

I hope that helps.

Cheers, David

unrelated PS: the changes you made to require hiera 3.5.0 in the Gemfile do
not work. It still pulls in version 3.4.5.13. I've created
https://github.com/puppetlabs/pdk-templates/issues/182 to ask for allowing
this to be overridden through the regular channels. At the same time, I'd
also caution against modifying these bits too radically, as the PDK chooses
the versions that we ship in the puppet-agent package, so changing that
around will invalidate your test results.


On Mon, Jan 28, 2019 at 3:21 PM Peter Berghold 
wrote:

> Gemfile
> source ENV['GEM_SOURCE'] || 'https://rubygems.org'
>
> def location_for(place_or_version, fake_version = nil)
>   git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?}
>   file_url_regex = %r{\Afile:\/\/(?.*)}
>
>   if place_or_version && (git_url = place_or_version.match(git_url_regex))
> [fake_version, { git: git_url[:url], branch: git_url[:branch],
> require: false }].compact
>   elsif place_or_version && (file_url =
> place_or_version.match(file_url_regex))
> ['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
>   else
> [place_or_version, { require: false }]
>   end
> end
>
> ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
> minor_version = ruby_version_segments[0..1].join('.')
>
> group :development do
>   gem "fast_gettext", '1.1.0', require: false if
> Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
>   gem "fast_gettext",  require: false if
> Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
>   gem "json_pure", '<= 2.0.1', require: false if
> Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
>   gem "json", '= 1.8.1',   require: false if
> Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
>   gem "json", '<= 2.0.4',  require: false if
> Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
>   gem "puppet-module-posix-default-r#{minor_version}", require: false,
> platforms: [:ruby]
>   gem "puppet-module-posix-dev-r#{minor_version}", require: false,
> platforms: [:ruby]
>   gem "puppet-module-win-default-r#{minor_version}",   require: false,
> platforms: [:mswin, :mingw, :x64_mingw]
>   gem "puppet-module-win-dev-r#{minor_version}",   require: false,
> platforms: [:mswin, :mingw, :x64_mingw]
> end
>
> puppet_version = ENV['PUPPET_GEM_VERSION']
> facter_version = ENV['FACTER_GEM_VERSION']
> hiera_version = ENV['3.5.0']
>
>
> gems = {}
>
> gems['puppet'] = location_for(puppet_version)
>
> # If facter or hiera versions have been specified via the environment
> # variables
>
> gems['facter'] = location_for(facter_version) if facter_version
> gems['hiera'] = location_for('3.5.1') if hiera_version
>
> if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
>   # If we're using a Puppet gem on Windows which handles its own win32-xxx
> gem
>   # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
>   gems['win32-dir'] =  ['<= 0.4.9', require: false]
>   gems['win32-eventlog'] = ['<= 0.6.5', require: false]
>   gems['win32-process'] =  ['<= 0.7.5', require: false]
>   gems['win32-security'] = ['<= 0.2.5', require: false]
>   gems['win32-service'] =  ['0.8.8', require: false]
> end
>
> gems.each do |gem_name, gem_params|
>   gem gem_name, *gem_params
> end
>
> # Evaluate Gemfile.local and ~/.gemfile if they exist
> extra_gemfiles = [
>   "#{__FILE__}.local",
>   File.join(Dir.home, '.gemfile'),
> ]
>
> extra_gemfiles.each do |gemfile|
>   if File.file?(gemfile) && File.readable?(gemfile)
> eval(File.read(gemfile), binding)
>   end
> end
> # vim: syntax=ruby
>
>
> On Mon, Jan 28, 2019 at 10:19 AM David Schmitt 
> wrote:
>
>> please also provide the Gemfile as I've asked above. Without that it's
>> impossible to reproduce locally and/or diagnose.
>>
>>
>>
>> On Mon, Jan 28, 2019 at 3:03 PM Peter Berghold 
>> wrote:
>>
>>> Yes that was done in a module created by PDK originally.
>>>
>>> Here is the debug output
>>>
>>> peter@saltycowdawg: mediawiki]:(master): pdk test unit --debug
>>> pdk (INFO): Using Ruby 2.5.1
>>> pdk (INFO): Using Puppet 6.0.2
>>> pdk (DEBUG): Checking for missing Gemfile dependencies.
>>> pdk (DEBUG): Using '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle'
>>> from PDK package.
>>> pdk (DEBUG): Executing
>>> '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle check
>>> --gemfile=/home/peter/prj-src/puppet/mediawiki/Gemfile --dry-run'
>>> pdk (DEBUG): Command environment:
>>> pdk (DEBUG):   PUPPET_GEM_VERSION: 6.0.2
>>> pdk (DEBUG):   BUNDLE_IGNORE_CONFIG: 1
>>> pdk (DEBUG):   GEM_HOME: /home/peter/.pdk/cache/ruby/2.5.0
>>> pdk 

Re: [Puppet Users] PDK on bionic Ubuntu

2019-01-28 Thread Peter Berghold
Gemfile
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

def location_for(place_or_version, fake_version = nil)
  git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?}
  file_url_regex = %r{\Afile:\/\/(?.*)}

  if place_or_version && (git_url = place_or_version.match(git_url_regex))
[fake_version, { git: git_url[:url], branch: git_url[:branch], require:
false }].compact
  elsif place_or_version && (file_url =
place_or_version.match(file_url_regex))
['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
  else
[place_or_version, { require: false }]
  end
end

ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
  gem "fast_gettext", '1.1.0', require: false if
Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
  gem "fast_gettext",  require: false if
Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
  gem "json_pure", '<= 2.0.1', require: false if
Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
  gem "json", '= 1.8.1',   require: false if
Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
  gem "json", '<= 2.0.4',  require: false if
Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
  gem "puppet-module-posix-default-r#{minor_version}", require: false,
platforms: [:ruby]
  gem "puppet-module-posix-dev-r#{minor_version}", require: false,
platforms: [:ruby]
  gem "puppet-module-win-default-r#{minor_version}",   require: false,
platforms: [:mswin, :mingw, :x64_mingw]
  gem "puppet-module-win-dev-r#{minor_version}",   require: false,
platforms: [:mswin, :mingw, :x64_mingw]
end

puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['3.5.0']


gems = {}

gems['puppet'] = location_for(puppet_version)

# If facter or hiera versions have been specified via the environment
# variables

gems['facter'] = location_for(facter_version) if facter_version
gems['hiera'] = location_for('3.5.1') if hiera_version

if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
  # If we're using a Puppet gem on Windows which handles its own win32-xxx
gem
  # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
  gems['win32-dir'] =  ['<= 0.4.9', require: false]
  gems['win32-eventlog'] = ['<= 0.6.5', require: false]
  gems['win32-process'] =  ['<= 0.7.5', require: false]
  gems['win32-security'] = ['<= 0.2.5', require: false]
  gems['win32-service'] =  ['0.8.8', require: false]
end

gems.each do |gem_name, gem_params|
  gem gem_name, *gem_params
end

# Evaluate Gemfile.local and ~/.gemfile if they exist
extra_gemfiles = [
  "#{__FILE__}.local",
  File.join(Dir.home, '.gemfile'),
]

extra_gemfiles.each do |gemfile|
  if File.file?(gemfile) && File.readable?(gemfile)
eval(File.read(gemfile), binding)
  end
end
# vim: syntax=ruby


On Mon, Jan 28, 2019 at 10:19 AM David Schmitt 
wrote:

> please also provide the Gemfile as I've asked above. Without that it's
> impossible to reproduce locally and/or diagnose.
>
>
>
> On Mon, Jan 28, 2019 at 3:03 PM Peter Berghold 
> wrote:
>
>> Yes that was done in a module created by PDK originally.
>>
>> Here is the debug output
>>
>> peter@saltycowdawg: mediawiki]:(master): pdk test unit --debug
>> pdk (INFO): Using Ruby 2.5.1
>> pdk (INFO): Using Puppet 6.0.2
>> pdk (DEBUG): Checking for missing Gemfile dependencies.
>> pdk (DEBUG): Using '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle'
>> from PDK package.
>> pdk (DEBUG): Executing '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle
>> check --gemfile=/home/peter/prj-src/puppet/mediawiki/Gemfile --dry-run'
>> pdk (DEBUG): Command environment:
>> pdk (DEBUG):   PUPPET_GEM_VERSION: 6.0.2
>> pdk (DEBUG):   BUNDLE_IGNORE_CONFIG: 1
>> pdk (DEBUG):   GEM_HOME: /home/peter/.pdk/cache/ruby/2.5.0
>> pdk (DEBUG):   GEM_PATH:
>> /opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0
>> pdk (DEBUG):   PATH:
>> /opt/puppetlabs/pdk/private/ruby/2.5.1/bin:/home/peter/.pdk/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0/bin:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0/bin:/opt/puppetlabs/pdk/bin:/home/peter/bin:/home/peter/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin:/opt/puppetlabs/pdk/private/git/bin
>> pdk (DEBUG): Execution of
>> '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle check
>> --gemfile=/home/peter/prj-src/puppet/mediawiki/Gemfile --dry-run' complete
>> (duration: 2.847360904s; exit code: 0)
>> pdk (DEBUG): Updating Gemfile dependencies.
>> pdk (DEBUG): Using 

Re: [Puppet Users] PDK on bionic Ubuntu

2019-01-28 Thread David Schmitt
please also provide the Gemfile as I've asked above. Without that it's
impossible to reproduce locally and/or diagnose.



On Mon, Jan 28, 2019 at 3:03 PM Peter Berghold 
wrote:

> Yes that was done in a module created by PDK originally.
>
> Here is the debug output
>
> peter@saltycowdawg: mediawiki]:(master): pdk test unit --debug
> pdk (INFO): Using Ruby 2.5.1
> pdk (INFO): Using Puppet 6.0.2
> pdk (DEBUG): Checking for missing Gemfile dependencies.
> pdk (DEBUG): Using '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle'
> from PDK package.
> pdk (DEBUG): Executing '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle
> check --gemfile=/home/peter/prj-src/puppet/mediawiki/Gemfile --dry-run'
> pdk (DEBUG): Command environment:
> pdk (DEBUG):   PUPPET_GEM_VERSION: 6.0.2
> pdk (DEBUG):   BUNDLE_IGNORE_CONFIG: 1
> pdk (DEBUG):   GEM_HOME: /home/peter/.pdk/cache/ruby/2.5.0
> pdk (DEBUG):   GEM_PATH:
> /opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0
> pdk (DEBUG):   PATH:
> /opt/puppetlabs/pdk/private/ruby/2.5.1/bin:/home/peter/.pdk/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0/bin:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0/bin:/opt/puppetlabs/pdk/bin:/home/peter/bin:/home/peter/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin:/opt/puppetlabs/pdk/private/git/bin
> pdk (DEBUG): Execution of
> '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle check
> --gemfile=/home/peter/prj-src/puppet/mediawiki/Gemfile --dry-run' complete
> (duration: 2.847360904s; exit code: 0)
> pdk (DEBUG): Updating Gemfile dependencies.
> pdk (DEBUG): Using '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle'
> from PDK package.
> pdk (DEBUG): Executing '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle
> lock --lockfile=/home/peter/prj-src/puppet/mediawiki/Gemfile.lock --update
> --local'
> pdk (DEBUG): Command environment:
> pdk (DEBUG):   BUNDLE_GEMFILE: /home/peter/prj-src/puppet/mediawiki/Gemfile
> pdk (DEBUG):   PUPPET_GEM_VERSION: 6.0.2
> pdk (DEBUG):   BUNDLE_IGNORE_CONFIG: 1
> pdk (DEBUG):   GEM_HOME: /home/peter/.pdk/cache/ruby/2.5.0
> pdk (DEBUG):   GEM_PATH:
> /opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0
> pdk (DEBUG):   PATH:
> /opt/puppetlabs/pdk/private/ruby/2.5.1/bin:/home/peter/.pdk/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0/bin:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0/bin:/opt/puppetlabs/pdk/bin:/home/peter/bin:/home/peter/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin:/opt/puppetlabs/pdk/private/git/bin
> pdk (DEBUG): Execution of
> '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle lock
> --lockfile=/home/peter/prj-src/puppet/mediawiki/Gemfile.lock --update
> --local' complete (duration: 0.22216318s; exit code: 1)
> pdk (FATAL):
> /opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems.rb:289:in
> `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle
> (Gem::GemNotFoundException)
> from
> /opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems.rb:308:in
> `activate_bin_path'
> from /opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle:23:in `'
>
> pdk (FATAL): Unable to resolve Gemfile dependencies.
> pdk (DEBUG):
> /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/lib/pdk/util/bundler.rb:185:in
> `update_lock!'
> pdk (DEBUG):
> /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/lib/pdk/util/bundler.rb:46:in
> `ensure_bundle!'
> pdk (DEBUG):
> /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/lib/pdk/cli/test/unit.rb:76:in
> `block (2 levels) in '
> pdk (DEBUG):
> /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:329:in
> `run_this'
> pdk (DEBUG):
> /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:269:in
> `run'
> pdk (DEBUG):
> /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:287:in
> `run'
> pdk (DEBUG):
> /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:287:in
> `run'
> pdk (DEBUG):
> /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/lib/pdk/cli.rb:18:in
> `run'
> pdk (DEBUG):
> /opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/exe/pdk:6:in
> `'
> pdk (DEBUG): /opt/puppetlabs/pdk/private/ruby/2.4.4/bin/pdk:23:in `load'
> pdk (DEBUG): /opt/puppetlabs/pdk/private/ruby/2.4.4/bin/pdk:23:in `'
>
>
> On Mon, Jan 28, 2019 at 4:27 AM David Schmitt 
> 

Re: [Puppet Users] PDK on bionic Ubuntu

2019-01-28 Thread Peter Berghold
Yes that was done in a module created by PDK originally.

Here is the debug output

peter@saltycowdawg: mediawiki]:(master): pdk test unit --debug
pdk (INFO): Using Ruby 2.5.1
pdk (INFO): Using Puppet 6.0.2
pdk (DEBUG): Checking for missing Gemfile dependencies.
pdk (DEBUG): Using '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle' from
PDK package.
pdk (DEBUG): Executing '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle
check --gemfile=/home/peter/prj-src/puppet/mediawiki/Gemfile --dry-run'
pdk (DEBUG): Command environment:
pdk (DEBUG):   PUPPET_GEM_VERSION: 6.0.2
pdk (DEBUG):   BUNDLE_IGNORE_CONFIG: 1
pdk (DEBUG):   GEM_HOME: /home/peter/.pdk/cache/ruby/2.5.0
pdk (DEBUG):   GEM_PATH:
/opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0
pdk (DEBUG):   PATH:
/opt/puppetlabs/pdk/private/ruby/2.5.1/bin:/home/peter/.pdk/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0/bin:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0/bin:/opt/puppetlabs/pdk/bin:/home/peter/bin:/home/peter/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin:/opt/puppetlabs/pdk/private/git/bin
pdk (DEBUG): Execution of
'/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle check
--gemfile=/home/peter/prj-src/puppet/mediawiki/Gemfile --dry-run' complete
(duration: 2.847360904s; exit code: 0)
pdk (DEBUG): Updating Gemfile dependencies.
pdk (DEBUG): Using '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle' from
PDK package.
pdk (DEBUG): Executing '/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle
lock --lockfile=/home/peter/prj-src/puppet/mediawiki/Gemfile.lock --update
--local'
pdk (DEBUG): Command environment:
pdk (DEBUG):   BUNDLE_GEMFILE: /home/peter/prj-src/puppet/mediawiki/Gemfile
pdk (DEBUG):   PUPPET_GEM_VERSION: 6.0.2
pdk (DEBUG):   BUNDLE_IGNORE_CONFIG: 1
pdk (DEBUG):   GEM_HOME: /home/peter/.pdk/cache/ruby/2.5.0
pdk (DEBUG):   GEM_PATH:
/opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0
pdk (DEBUG):   PATH:
/opt/puppetlabs/pdk/private/ruby/2.5.1/bin:/home/peter/.pdk/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/gems/2.5.0/bin:/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/bin:/opt/puppetlabs/pdk/private/puppet/ruby/2.5.0/bin:/opt/puppetlabs/pdk/bin:/home/peter/bin:/home/peter/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin:/opt/puppetlabs/pdk/private/git/bin
pdk (DEBUG): Execution of
'/opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle lock
--lockfile=/home/peter/prj-src/puppet/mediawiki/Gemfile.lock --update
--local' complete (duration: 0.22216318s; exit code: 1)
pdk (FATAL):
/opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems.rb:289:in
`find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle
(Gem::GemNotFoundException)
from
/opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems.rb:308:in
`activate_bin_path'
from /opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle:23:in `'

pdk (FATAL): Unable to resolve Gemfile dependencies.
pdk (DEBUG):
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/lib/pdk/util/bundler.rb:185:in
`update_lock!'
pdk (DEBUG):
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/lib/pdk/util/bundler.rb:46:in
`ensure_bundle!'
pdk (DEBUG):
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/lib/pdk/cli/test/unit.rb:76:in
`block (2 levels) in '
pdk (DEBUG):
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:329:in
`run_this'
pdk (DEBUG):
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:269:in
`run'
pdk (DEBUG):
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:287:in
`run'
pdk (DEBUG):
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:287:in
`run'
pdk (DEBUG):
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/lib/pdk/cli.rb:18:in
`run'
pdk (DEBUG):
/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0/gems/pdk-1.8.0/exe/pdk:6:in
`'
pdk (DEBUG): /opt/puppetlabs/pdk/private/ruby/2.4.4/bin/pdk:23:in `load'
pdk (DEBUG): /opt/puppetlabs/pdk/private/ruby/2.4.4/bin/pdk:23:in `'


On Mon, Jan 28, 2019 at 4:27 AM David Schmitt 
wrote:

> Hi Peter,
>
> is the module compatible to the PDK? That is, have you created the module
> with the PDK, and/or ran `pdk convert`/`pdk update` successfully on it?
>
> If no, please do so before trying to run any other PDK commands in a
> module.
>
> If yes, please capture the full output of the command you're running after
> adding 

Re: [Puppet Users] PDK on bionic Ubuntu

2019-01-28 Thread David Schmitt
Hi Peter,

is the module compatible to the PDK? That is, have you created the module
with the PDK, and/or ran `pdk convert`/`pdk update` successfully on it?

If no, please do so before trying to run any other PDK commands in a module.

If yes, please capture the full output of the command you're running after
adding `--debug`, and - for this specific case - the Gemfile. With that
information we'll have a better chance of figuring out what's going on
there.


Cheers, David

On Sat, Jan 26, 2019 at 3:43 PM Peter Berghold 
wrote:

> When I run "pdk test unit" I get the following error:
> pdk (INFO): Using Ruby 2.5.1
> pdk (INFO): Using Puppet 6.0.2
> pdk (FATAL):
> /opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems.rb:289:in
> `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle
> (Gem::GemNotFoundException)
> from
> /opt/puppetlabs/pdk/private/ruby/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems.rb:308:in
> `activate_bin_path'
> from /opt/puppetlabs/pdk/private/ruby/2.5.1/bin/bundle:23:in `'
>
> pdk (FATAL): Unable to resolve Gemfile dependencies.
>
> I did a "gem list" and bundler is installed. What is the magic foo that I
> can do to make this work?
>
>
> --
>
> Peter L. Berghold   salty.cowd...@gmail.com
>
> h ttp://science-fiction.berghold.net
>
> --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAArvnv1gacMoibL%3DZm9D_icP%2Bse5WvWsiSFMnp69GF2yzSra%3DQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Cheers, David

https://twitter.com/dev_el_ops

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CALF7fHafxdimbH6KfORRtK3LMRm5zRr8s9cOi_WCd3avYJg93g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.