salt-bootstrap icon indicating copy to clipboard operation
salt-bootstrap copied to clipboard

Bootstrap fails when no curl/wget/fetch/ftp is installed

Open digitalkram opened this issue 4 years ago • 0 comments

Description of Issue/Question

When bootstrapping from a minimal Ubuntu 18.04 image bootstrapping fails: * ERROR: Failed to run install_ubuntu_stable_deps()!!!

The reason is that it cannot retrieve repo.saltstack.com/apt/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub

This only happen when this condition is met: if [ "$_DISABLE_REPOS" -eq "$BS_FALSE" ] || [ "$_CUSTOM_REPO_URL" != "null" ];

Which is given with my set of parameters that I need (for our network), which are: script_args: -U -p curl -l -R <internal ip>/repo/repo.saltstack.com (implies -r true)

I can see it tries using curl/wget/fetch/ftp - all of which are not available. While there are a lot of obvious possible solutions to the issue all approaches are not compatible with a mindset of a perfectly generic/minimal OS image.

I was hoping to get away with script_args containing -p curl however (as written in the parameter description) this happens only together with the salt dependencies. So that's a "chicken/egg" situation.

With the above parameter combination install_ubuntu_stable_deps() calls __install_saltstack_ubuntu_repository (which tries to fetch the GPG key) before install_ubuntu_deps is executed (which would install the _EXTRA_PACKAGES originating from -p).

Setup

not relevant

Steps to Reproduce Issue

Use bootstrap script with those parameters: script_args: -U -p curl -l -R <internal ip>/repo/repo.saltstack.com on a minimal OS setup that does not come with either one of curl/wget/fetch/ftp pre-installed.

Versions and Systems

not relevant (Minion OS is Ubuntu 18.04)

digitalkram avatar Aug 07 '20 09:08 digitalkram