What's the correct way to install packages into onedir during bootstrapping?
smitelli opened this issue · 0 comments
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
- bootstrap-salt.sh version 2023.04.26
- salt version 3006.1
- debian 11 bullseye (x86_64)