ubuntu-18.04salt-projectsalt-cloud

How should one configure or install salt-cloud to use the Saltstack py3 repository to install the minion instead of the distribution (apt) repository?


I would like salt-cloud to install the salt-minion using the same sources.list.d/saltstack.list file that is on the saltmaster server, but it uses the Ubuntu APT repository instead.

What I get on a new minion in /etc/apt/sources.list.d/saltstack.list:

deb https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic main

What I want:

deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main

I installed salt-master and salt-cloud from the Saltstack repository by doing the following on my saltmaster server:

wget -O - https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
echo "deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main" > etc/apt/sources.list.d/saltstack.list
apt update
apt install python3-pip salt-master salt-minion salt-cloud

I spin up a server using salt-cloud and the /etc/apt/sources.list.d/saltstack.list without fail uses the apt repository, not the py3 repository.

Is there an option I can set in the saltmaster configuration file that defines which repository salt-cloud should use? Is there a similar option in a salt-cloud profile that can be passed to the salt bootstrap script?

I see in the bootstrap script that salt-cloud runs (found at bootstrap.saltstack.com) a command line option called _CUSTOM_REPO_URL, but I don't know how to pass options to that script when creating a server with salt-cloud -p

Happy to ask elsewhere (please indicate where) if more appropriate.

I can provide applicable parts of my salt-cloud profile if needed.


Solution

  • I found https://docs.saltstack.com/en/latest/topics/cloud/deploy.html#deploy-script-arguments

    That led me to add the following to my cloud server profile used with the salt-cloud -p command:

    script: bootstrap-salt
    script_args: -x python3
    

    Then the correct repository was installed.