salt icon indicating copy to clipboard operation
salt copied to clipboard

bootstrap breaks /etc/salt/minion upon installation via salt-cloud

Open ksmitdevops opened this issue 11 years ago • 5 comments

Hi,

I am using salt-cloud to provision virtual machines in vmware using a Debian Jessie template that does not have salt installed. What happens is it appears that the bootstrap script installs saltstack 2015.5.3 (which is one thing I'm concerned about.. why not install 2015.8??) and creates /etc/salt/minion which is broken b/c of this line:

master_type:  str

Salt-cloud output:

...
...
...
[DEBUG   ]  *  INFO: Running install_debian_check_services()
 *  INFO: Running install_debian_restart_daemons()
 *  INFO: Running daemons_running()
[DEBUG   ]  *  INFO: Running daemons_running()
Connection to 10.10.13.166 closed.
[DEBUG   ] Connection to 10.10.13.166 closed.
 * ERROR: salt-minion was not found running
 * ERROR: Failed to run daemons_running()!!!
 * ERROR: salt-minion was not found running. Pass '-D' to bootstrap-salt.sh when bootstrapping for additional debugging information...
[DEBUG   ]  * ERROR: salt-minion was not found running
 * ERROR: Failed to run daemons_running()!!!
 * ERROR: salt-minion was not found running. Pass '-D' to bootstrap-salt.sh when bootstrapping for additional debugging information...
Error: There was a profile error: Command 'ssh -t -t -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oControlPath=none -p 22 [email protected] \'/tmp/.saltcloud-a7cbb080-f852-4568-867d-4b66a8a355fc/deploy.sh -c \'"\'"\'/tmp/.saltcloud-a7cbb080-f852-4568-867d-4b66a8a355fc\'"\'"\' -K\'' failed. Exit code: 1

When I log into my newly provisioned vm and try starting salt-minion, it complains with this error in /var/log/salt/minion:

2015-10-14 15:39:37,977 [salt.minion      ][ERROR   ][2926] Invalid keyword 'str' for variable 'master_type'
2015-10-14 15:39:37,977 [salt.cli.daemons ][INFO    ][2926] The salt minion is shut down

If I comment out the master_type: str bit in /etc/salt/minion, salt-minion starts up successfully.

My questions are why isn't the bootstrap script installing 2015.8 and what's up with the broken master_type configurable in /etc/salt/minion? For some reason, bootstrap is creating this file:

/etc/apt/sources.list.d/saltstack.list

deb http://debian.saltstack.com/debian jessie-saltstack main

Instead, I would expect it to look like this, which would install 2015.8:

deb http://repo.saltstack.com/apt/debian jessie contrib

ksmitdevops avatar Oct 14 '15 19:10 ksmitdevops

@schlagify For the question about installing the newer versions of Salt from the bootstrap script, this is because we haven't updated the bootstrap script to point to SaltStack's new repo.saltstack.com repo. The bootstrap script still points to the Community Repo, which are not up-to-date yet. A more in-depth discussion of that can be found in #27880.

The master_type: str issue is a known bug with 2015.5.3 and has been fixed on newer releases. For the time being, if you need to continue to use salt-cloud with stable packages from the community repos, you can add:

minion:
    master_type: standard

to your cloud configs to get you past the error. Otherwise, if you'd like to install the 2015.8.0 release, I'd recommend installing from the git tag. You can do this by placing:

script_args: git v2015.8.0

In your cloud configs.

Does that help answer your questions?

rallytime avatar Oct 14 '15 19:10 rallytime

@rallytime thanks for the advice. the script_args: git v2015.8.0 configurable resulted in a bunch of errors and a broken salt-minion installation, so instead what i decided to do was create an /etc/apt/sources.list.d/saltstack.list file on my template which points to repo.saltstack.com, which seemed to help.. at least 2015.8 was installed via apt. i also used master_type: standard in my salt-cloud profile config, and it created /etc/salt/minion with that line in it, only now salt-minion won't start b/c it doesn't like that either. is there a way to prevent master_type from being included in /etc/salt/minion entirely? i think that would at least enable me to provision a bunch of servers with 2015.8 and get salt-minion running successfully.

fwiw, my salt-master is running 2015.8 and is where i'm running salt-cloud from.

ksmitdevops avatar Oct 14 '15 20:10 ksmitdevops

Oh, I forgot to tell you that this version of the bootstrap script also need -P in the script_args to allow pip based installations (script_args: -P git v2015.8.0). You shouldn't need the master_type declaration in your cloud configs anymore if you're installing 2015.8.0.

rallytime avatar Oct 14 '15 20:10 rallytime

@rallytime thank you for the clarification. i was able to get everything working by having /etc/apt/sources.list.d/saltstack.list in place on my template (which points to the repo.saltstack.com repo) and removed the master_type: standard from my cloud profile. now 2015.8 gets installed and salt-minion runs. yay, thanks again! closing out this issue.

ksmitdevops avatar Oct 14 '15 21:10 ksmitdevops

Woohoo! Happy to help! Glad you were able to get it working!

rallytime avatar Oct 14 '15 21:10 rallytime