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

install task incorrectly identifies Puppet as not installed on target hosts missing the which program. #703

Closed
zbentley opened this issue Feb 27, 2024 · 0 comments · Fixed by #704
Labels
bug Something isn't working

Comments

@zbentley
Copy link
Contributor

Describe the Bug

If a target of the install task does not have a which program available, but does have Puppet installed, the install task incorrectly attempts to re-install puppet.

Expected Behavior

If Puppet and its dependencies are installed correctly on a Linux target, the install task in this module should not attempt to reinstall them.

Steps to Reproduce

  1. Install Arch Linux in a barebones/default config following the docs. In particular, install no additional packages beyond what is absolutely necessary.
  2. Since Bolt cannot yet automate the installation of Puppet on Arch, install Puppet on Arch manually using the suggested installation procedure: pacman -S puppet.
  3. Make sure which is not installed on the Arch target (which is the default situation of fresh installs): pacman -R which.
  4. From a system with Bolt installed, attempt to run the install task on the Arch target: bolt task run puppet_agent::install --targets arch --log-level debug.
  5. Observe that a failure installing puppet occurs despite Puppet already being correctly installed on the target host:
{"target":"arch","action":"task","object":"puppet_agent::install","status":"failure","value":{"_output":"20:08:19 +0000 INFO: Version parameter not defined and no agent detected. Assuming latest.\n20:08:19 +0000 INFO: Downloading Puppet latest for Arch...\n20:08:19 +0000 CRIT: Sorry Arch is not supported yet!\n","_error":{"kind":"puppetlabs.tasks/task-error","issue_code":"TASK_ERROR","msg":"The task failed with exit code 1","details":{"exit_code":1}}}}

That failure is expected: Arch is not supported by this module for Puppet installation, but there's no reason it can't be supported by this module if Puppet is already correctly installed on the target.

Environment

  • Bolt 3.28, running from MacOS 14.
  • Puppet 7.27 on ruby 3
  • Arch Linux installed according to the default install guide suggestions (kernel 6.7.6 as of this writing).

Additional Context

The failure is occurring due to this line: https://github.com/puppetlabs/puppetlabs-puppet_agent/blob/main/tasks/install_shell.sh#L147

which is not a shell builtin or a requirement of a POSIX-compliant environment.

Surprisingly (at least to me), it's also not installed by default as a transitive or part of the core system packages on Arch, so this is less "my environment is weird for personal reasons" and more "a popular distro is weird missing a dependency of this module".

@zbentley zbentley added the bug Something isn't working label Feb 27, 2024
mhashizume added a commit that referenced this issue Feb 29, 2024
[Fix #703] use 'type' instead of 'which' for increased portability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant