Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"bolt module install" no longer works on v3.16 when there's a task plugin in the bolt-project file #2992

Closed
jschoewe opened this issue Aug 19, 2021 · 0 comments · Fixed by #2993
Assignees
Labels
Bug Bug reports and fixes.

Comments

@jschoewe
Copy link

Describe the Bug

When running "bolt module install" on a project, installing the modules from the Puppetfile needs to be the first thing that happens because tasks from those modules sometimes need to be used as plugins in the bolt-project.yaml file.

Steps to Reproduce

Steps to reproduce the behavior:

Puppetfile:

mod 'puppetlabs-stdlib'
mod 'encore-inventory_utils'

bolt-project.yaml

---
name: deploy

# paths are relative to this bolt.yaml file
hiera-config: "./hiera.yaml"
modulepath: "./modules_extern:./modules"

log:
  console:
    level: info

plugins:
  pkcs7:
    public_key:
      _plugin: task
      task: inventory_utils::pick_path
      parameters:
        paths:
          - ~/.ssh/public_key.pkcs7.pem
          - ~/.puppetlabs/bolt/keys/public_key.pkcs7.pem
    private_key:
      _plugin: task
      task: inventory_utils::pick_path
      parameters:
        paths:
          - ~/.ssh/private_key.pkcs7.pem
          - ~/.puppetlabs/bolt/keys/private_key.pkcs7.pem

Running "bolt module install" on a project with these files results in the following error:

Loaded project from '/path/to/project/deploy'
Could not find a task named 'inventory_utils::pick_path'. For a list of available tasks, run 'bolt task show'.

Expected Behavior

Prior to version 3.16, these modules were being installed fine and we were able to use their tasks in the bolt-project file.

Environment

RHEL 8

@jschoewe jschoewe added the Bug Bug reports and fixes. label Aug 19, 2021
@jschoewe jschoewe changed the title "bolt module install" no longer works when there's a task plugin in the bolt-project file "bolt module install" no longer works on v3.16 when there's a task plugin in the bolt-project file Aug 19, 2021
beechtom added a commit to beechtom/bolt that referenced this issue Aug 19, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 19, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
@beechtom beechtom added this to 📝 To Do in Bolt Kanban via automation Aug 19, 2021
@beechtom beechtom self-assigned this Aug 19, 2021
@beechtom beechtom moved this from 📝 To Do to ⚡️ Doing in Bolt Kanban Aug 19, 2021
beechtom added a commit to beechtom/bolt that referenced this issue Aug 19, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 19, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
@beechtom beechtom linked a pull request Aug 19, 2021 that will close this issue
beechtom added a commit to beechtom/bolt that referenced this issue Aug 19, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 19, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
beechtom added a commit to beechtom/bolt that referenced this issue Aug 19, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
@beechtom beechtom moved this from ⚡️ Doing to 🚧 Reviewing in Bolt Kanban Aug 19, 2021
beechtom added a commit to beechtom/bolt that referenced this issue Aug 19, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 19, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
beechtom added a commit to beechtom/bolt that referenced this issue Aug 20, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 20, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
beechtom added a commit to beechtom/bolt that referenced this issue Aug 20, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 20, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
beechtom added a commit to beechtom/bolt that referenced this issue Aug 20, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 20, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
beechtom added a commit to beechtom/bolt that referenced this issue Aug 20, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 20, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
beechtom added a commit to beechtom/bolt that referenced this issue Aug 23, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 23, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
beechtom added a commit to beechtom/bolt that referenced this issue Aug 25, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 25, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
beechtom added a commit to beechtom/bolt that referenced this issue Aug 25, 2021
This updates the Bolt to only resolve plugin config (`plugins`) and
plugin hooks (`plugin-hooks`) as needed. Previously, when Bolt setup the
`Bolt::Plugin` class, it resolved all plugin config and hooks as part of
the setup process. Because Bolt now loads the `Bolt::Plugin` class for
all commands, this resulted in Bolt erroring in cases where a plugin
module was not available, even if the command run didn't need access to
any plugins. This is particularly problematic for the `module install`
command, as users installing the project for the first time would be
attempting to install the very plugin modules that Bolt will say are
missing when the command is run.

!bug

* **Resolve plugins as needed**
  ([puppetlabs#2992](puppetlabs#2992))

  Bolt now only resolves plugin configuration, plugin hooks, and
  inventory plugins as needed. Previously, Bolt resolved all plugins
  each time a command was run, causing some commands to fail when
  they should not.
beechtom added a commit to beechtom/bolt that referenced this issue Aug 25, 2021
This updates the inventory to defer resolving plugins until the
inventory is needed. During the CLI refactor, Bolt was changed to always
load the inventory, regardless of whether the inventory was actually
used. This resulted any plugins in an inventory being resolved whenever
a Bolt command was run, potentially leading to a significant degradation
in performance.

Now, when the inventory is instantiated, Bolt only stores the raw
inventory data. Once Bolt requests access to any of the groups, targets,
or config in the inventory, the inventory parses the data, resolves
plugin references, and loads the groups and targets into inventory.

!no-release-note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug reports and fixes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants