-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
salt-master error on target VM when salt-cloud run as non-root #51127
Comments
you can add master configuration options like so:
in your profile or map file https://docs.saltstack.com/en/latest/topics/cloud/misc.html#setting-up-new-salt-masters |
That worked great! Another problem is some possible indirect salt documentation conflicts. This doc says to use the
I had assumed it extended in general to all master options. |
Also, this doc says the minion options are to be placed in the So maybe a docs adjustment? |
it should encompass all master options if you set them in the map file
you can set them in either the cloud or map file. since those docs are specific to /etc/salt/cloud and map has its own documentation i think this is clear enough unless you see otherwise |
I disagree on the docs handling. If Saltstack is formatting their docs to keep each configuration file separate, then their needs to be redundancy to re-explain how that same variable/setting/flag should be formatted and used in the new configuration file. But that is exactly what is not happening here. All over the salt docs they mention a variable/setting/flag, show an example of it, and then list the files it can be placed in. Therefore, the doc that says the configuration variable can explicitly be set in the cloud file needs to be changed to state it can be done in the cloud file or the map file. |
I am happy to do it myself. Though, it may take time since I haven't done so before, and I am a bit slow on getting through all your procedure docs for contributing. |
I agree we could make it more clear on each doc to make sure its clear this option is able to be set elsewhere :) For contributing since this is documentation you probably want to submit it to the 2018.3 branch so it shows up on that branch and 2019.2, and develop once its merged forward. The docs for submitting documentation is here: https://docs.saltstack.com/en/latest/topics/development/conventions/documentation.html let me know if you have any other questions. I would be glad to help |
Alright, I am trying to make the documentation changes for this. However, after building the docs and making the changes to the relevant html page I realized the |
https://docs.saltstack.com/en/latest/topics/development/hacking.html#editing-and-previewing-the-documentation |
you wont want to submit the changes that are added to the _build folder. Can you clarify the exact files that you are trying to edit? |
@Ch3LL this issue is marked with the bug label, and I do think there is a bug. Do you want me to make a clone issue for the bug or leave this one open? |
i labeled this a documentation bug, not a bug in salt's code. What issue are you referring to? And yes if there is another issue outside of documentation lets close here and open a new one |
The original error this issue was based off of had peculiar behavior. Before you showed me how to set the host as the deescalated user properly, every time I created a new vm from salt-cloud that vm would try to do everything in my deescalated user. The behavior that I thought was a bug, was "an incorrect master configuration file is being produced by salt-cloud." |
I am going to close this issue and if someone runs into the original error and odd behavior they can re-open this for further discussion. |
Description of Issue
When provisioning salt-master onto a VM with salt-cloud, and
salt-cloud
is ran as an unprivileged (non-root) user, the salt-master fails on the target VM because an incorrect master configuration file is being produced by salt-cloud. This file among other things, sets user (on the target) as my username from the host computer I ran salt-cloud from. This results in salt-master (on the target) trying to set up the salt environment for the user alan-cugler. Again, to emphasize,alan-cugler
doesn’t exist on the vm - it’s my username on the host I ransalt-cloud
from.It seems a different master.conf file is being created and used with the
user: alan-cugler
. I provide empty (except comments)salt/master
andsalt/cloud
files.Possibly related issue: #46904
I have included reference links for context, and steps to reproduce, all below:
Steps to Reproduce Issue
Setup
wget -O bootstrap-salt.sh https://bootstrap.saltstack.com
sudo sh bootstrap-salt.sh -L -X -N -M
NOTE:
cp -f _syspaths.py /usr/lib/python2.7/dist-packages/salt/_syspaths.py
Configuration
Error
Run salt-cloud with
This will result in a salt-master error on the Digitalocean VM.
When you login to the VM via ssh as root you can use
to see a similar error report:
I have tried putting
user: root
in thesalt/cloud
,salt/master
, andsalt/cloud.maps.d/digitalocean-maps.conf
files but this did not change anything besides my own system getting confused saying thatsalt-cloud
had to be ran as the same user being listed in those files. In other words, I ransalt-cloud
as a non-root useralan-cugler
, which conflicts withroot
listed in those files.Adding
user:root
to thesalt/cloud
file seems to apply to the master on my host, not the master on the target:The docs show how to write variables to effect the minions, and I am guessing that I could do that for the master as well. If not I'd love to know how to.
Versions Report
Resources
The text was updated successfully, but these errors were encountered: