puppetlabs / puppet-enterprise_issues

This repository will allow public community members to file bug reports against Puppet Enterprise
1 stars 0 forks source link

Unable to install PE using PIM on Windows #4

Open cwebster61083 opened 6 months ago

cwebster61083 commented 6 months ago

Describe the Bug

When using PIM on Windows, I get a permission denied error when it tries to create /etc/puppetlabs on my installation target.

I am using the same user and ssh key used in our support lab, so I suspect there is an issue with how Bolt is configured to make the ssh connection.

I did attempt to recreate what we are doing in our lab provisioned by creating an inventory.yaml file in the .BProject folder, but it gets deleted as soon as the installer starts. Below is the contents of the inventory.yaml.

config:
  transport: ssh
  ssh:
    host-key-check: false
    run-as: root
    user: user
    private-key: ~/.ssh/id_rsa-acceptance

Expected Behavior

PE should be installed without getting a permission error.

Steps to Reproduce

Steps to reproduce the behavior:

On a fresh Windows node with no previously configured SSH configs, run through the PIM installer using only the SSH user and key for that user.

Environment

image

cwebster61083 commented 6 months ago

Using the following, I can use the parameter file generated by PIM with PEADM. The --run-as root allowed it to progress through where it failed before.

PS C:\Users\user\Downloads\puppet-installation-manager-v1.0.0-windows\.BProject> bolt plan run peadm::install --params @C:\Users\user\Downloads\puppet-installation-manager-v1.0.0-windows\data\fail_install_20240222_184021.json --no-ssl-verify --no-host-key-check --private-key C:\Users\user\.ssh\id_rsa-acceptance --run-as root
cwebster61083 commented 6 months ago

Adding the following to bolt-defaults.yaml under C:\Users\user\.puppetlabs\etc\bolt also resolved the issue.

inventory-config:
  transport: ssh
  ssh:
    host-key-check: false
    run-as: root
    user: user
    private-key: ~/.ssh/id_rsa-acceptance

We may want to add some options in the wizard to be able to pass --run-as to the bolt plan command that gets used to do the install.

github-actions[bot] commented 5 months ago

Migrated issue to PE-37950

ragingra commented 5 months ago

@cwebster61083 Hey Chris! Thanks for the raising this issue! Through the wizard part of the tool we don't have a mechanism for passing through bolt parameters, but we do on other parts such as the install/upgrade/convert commands. With these, you can pass any bolt parameters through with the "-b" flag.

PS C:\Users\Administrator\Desktop> ./pim install .\params.json -b run-as=root

Installing Puppet with {"console_password": "puppetlabs","download_mode": "direct","primary_host": "bare-protoplasm.delivery.puppetlabs.net","version": "2023.6.0"}... Bolt flags: [--run-as root]

As more of an improvement to help with the wizard part of the tool, do you think that it would be beneficial to add a run-as input, or a checkbox for run-as root? This wouldn't cover every bolt param, so maybe we still need to have a more generic way of passing them in such as the -b way on install. If there are a couple of common params that users would need more often then maybe adding them as inputs/toggles in the wizard might be a good idea.

I did test the above command on windows passing in the params file generated from the wizard and hit an issue with unmarshalling the json. Think it's a windows whitespace issue and have a ticket raised for it.

cwebster61083 commented 5 months ago

That all makes sense to me. Adding run as root would be good, as it is a very common option people need to set when running bolt jobs against Linux. Specifically for the Windows demographic, PIM needs to feel as much like a GUI as possible. Windows admins do not always want to dig through the command line to do something they expect the GUI to cover. I guess what I mean is that the bolt aspect of the installation should be as transparent as possible; otherwise, folks will feel they need to learn another tool to do the installation, which will detract from getting PE installed. I hope that makes sense.