saltstack / salt-bootstrap

Generic Salt Bootstrap Script
Other
926 stars 545 forks source link

What's the correct way to install packages into onedir during bootstrapping? #1933

Open smitelli opened 1 year ago

smitelli commented 1 year ago

Description of Issue/Question

When installing the new "onedir" version of Salt, by default there are no pip packages installed to allow for connection to a MySQL database. All of the mysql.* states fail with an error similar to the following:

----------
          ID: db-user
    Function: mysql_user.present
        Name: testing
      Result: False
     Comment: State 'mysql_user.present' was not found in SLS 'salt.minion'
              Reason: 'mysql_user' __virtual__ returned False: mysql module could not be loaded
     Changes:
----------

In order to make these work, I find I now have to install the build-essential and libmariadb-dev packages using the system package manager, then install mysqlclient into onedir using salt-pip. That works and is relatively straightforward, but it feels like I'm doing something wrong by installing things in this way.

The pre-onedir versions of Salt (3005 and earlier) worked out of the box in this regard -- once bootstrap-salt.sh finished I was able to use mysql.* states without any additional effort. I opened this issue to inquire if there was a way for salt-bootstrap to make this simpler and less platform-specific for me.

Setup

sudo ./bootstrap-salt.sh -X -F -c /tmp
sudo apt-get install build-essential libmariadb-dev
sudo salt-pip install mysqlclient

Versions and Systems

dmurphy18 commented 2 months ago

@smitelli Can you retry with the latest bootstrap script which has been heavily updated this July, noting that support for older EOL version of Salt has been dropped. If the latest version of the bootstrap scrip resolves your issues, please consider closing this issue.