Skip to content

litmus does not see bolt inventory plugins #411

@shaun-rutherford

Description

@shaun-rutherford

Describe the bug
Greetings,
It appears the PDK does not support bolts various inventory plugins for use with puppet_litmus.

I made sure the bolt and puppet_litmus gem PDK uses is the latest available and tried installing the puppetlabs-terraform bolt module via PDK, still fails with the following:

pdk bundle exec bolt module add puppetlabs-terraform
pdk (INFO): Using Ruby 2.5.8
pdk (INFO): Using Puppet 6.21.1
Bolt might be installed as a gem. To use Bolt reliably and with all of its
dependencies, uninstall the 'bolt' gem and install Bolt as a package:
https://puppet.com/docs/bolt/latest/bolt_installing.html

If you meant to install Bolt as a gem and want to disable this warning,
set the BOLT_GEM environment variable. [ID: gem_install]
Project configuration file /home/user/.puppetlabs/bolt/bolt-project.yaml already includes specification with name puppetlabs-terraform. Nothing to do.
pdk bundle exec rake litmus:install_agent
pdk (INFO): Using Ruby 2.5.8
pdk (INFO): Using Puppet 6.21.1
install_agent
rake aborted!
Bolt::Plugin::PluginError::Unknown: Unknown plugin: 'terraform'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/plugin.rb:231:in `get_hook'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/plugin.rb:311:in `resolve_single_reference'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/plugin.rb:289:in `resolve_top_level_references'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/plugin.rb:284:in `block in resolve_top_level_references'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/plugin.rb:284:in `each'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/plugin.rb:284:in `flat_map'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/plugin.rb:284:in `resolve_top_level_references'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/inventory/group.rb:52:in `initialize'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/inventory/group.rb:84:in `new'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/inventory/group.rb:84:in `block in initialize'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/inventory/group.rb:84:in `map'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/inventory/group.rb:84:in `initialize'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/inventory/inventory.rb:24:in `new'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/inventory/inventory.rb:24:in `initialize'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/inventory.rb:114:in `new'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt/inventory.rb:114:in `create_version'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt_spec/run.rb:170:in `inventory'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt_spec/run.rb:195:in `run_task'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt_spec/run.rb:26:in `block in run_task'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt_spec/run.rb:152:in `block in with_runner'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt_spec/run.rb:150:in `with_runner'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/bolt-3.7.0/lib/bolt_spec/run.rb:25:in `run_task'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/puppet_litmus-0.27.0/lib/puppet_litmus/rake_helper.rb:225:in `block in install_agent'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/honeycomb-beeline-2.4.0/lib/honeycomb/client.rb:70:in `start_span'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/puppet_litmus-0.27.0/lib/puppet_litmus/rake_helper.rb:210:in `install_agent'
/home/srutherford/.pdk/cache/ruby/2.5.0/gems/puppet_litmus-0.27.0/lib/puppet_litmus/rake_tasks.rb:126:in `block (2 levels) in <top (required)>'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/honeycomb-beeline-2.4.0/lib/honeycomb/integrations/rake.rb:21:in `block in execute'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/honeycomb-beeline-2.4.0/lib/honeycomb/client.rb:70:in `start_span'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/honeycomb-beeline-2.4.0/lib/honeycomb/integrations/rake.rb:16:in `execute'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
/opt/puppetlabs/pdk/private/ruby/2.5.8/bin/bundle:23:in `load'
/opt/puppetlabs/pdk/private/ruby/2.5.8/bin/bundle:23:in `<main>'
Tasks: TOP => litmus:install_agent
(See full trace by running task with --trace)

To Reproduce
Download puppetlabs-motd
Add spec/fixtures/litmus_inventory.yaml with terraform plugin data:

groups:
  - name: cloud-webs
    targets:
      - _plugin: terraform
        dir: /home/srutherford/Documents/Git/Terraform/gcp_instance_test
        resource_type: google_compute_instance.default
        target_mapping:
          uri: network_interface.0.network_ip

Run pdk bundle install
Run pdk bundle exec rake litmus:install_agent
Run pdk bundle exec rake litmus:install_module

Expected behavior
The PDK should be able to run the bolt commands without error.

Additional context

  • Your PDK installation method
    installed via native package on CentOS8

  • Your PDK version (pdk --version)
    pdk --version
    2.1.0

  • Your operating system / platform
    CentOS 8

I'm able to run commands using the Bolt I've installed from Puppetlabs CentOS repository using the terraform plugin:

bolt task run puppet_agent::install -i spec/fixtures/litmus_inventory.yaml --targets cloud-webs --run-as root
CLI arguments ["run-as"] might be overridden by Inventory: /home/srutherford/Documents/Git/Puppet/puppetlabs-motd/spec/fixtures/litmus_inventory.yaml [ID: cli_overrides]
Started on 10.180.23.173...
Finished on 10.180.23.173:
  19:33:54 +0000 INFO: Version parameter not defined and agent detected. Nothing to do.
Successful on 1 target: 10.180.23.173
Ran on 1 target in 1.55 sec

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions