Skip to content
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-cloud should install same minion version as master #56266

Closed
kveroneau opened this issue Feb 27, 2020 · 4 comments
Closed

salt-cloud should install same minion version as master #56266

kveroneau opened this issue Feb 27, 2020 · 4 comments
Assignees
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
Milestone

Comments

@kveroneau
Copy link

Description of Issue

When using salt-cloud to spin up cloud servers, when bootstrapping the salt-minion, the same version which is on the master should be bootstrapped onto the minion for maximum compatibility. I am currently trying to troubleshoot an issue, which I believe is related to the master and minion being different versions.

Setup

Use a Salt-master at version 2019.2.3, and bootstrap a cloud server using salt-cloud.

Steps to Reproduce Issue

Run the salt-cloud state to create the cloud VM, and notice that version 3000 ends up being bootstrapped.

Versions Report

Salt Version:
Salt: 2019.2.3

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.5.3
docker-py: 4.1.0
gitdb: 2.0.0
gitpython: 2.1.1
ioflo: Not Installed
Jinja2: 2.9.4
libgit2: 0.24.5
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: 0.24.2
Python: 2.7.13 (default, Sep 26 2018, 18:42:22)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 2.0.1
timelib: Not Installed
Tornado: 4.4.3
ZMQ: 4.2.1

System Versions:
dist: debian 9.11
locale: UTF-8
machine: x86_64
release: 4.9.0-11-amd64
system: Linux
version: debian 9.11

@kveroneau
Copy link
Author

This is the error I receive when using any mysql related execution commands, such as mysql.version. This same error does not occur on other minions configured the same way at salt version 2019.2.3, so I suspect that this error is being triggered due to the master being at 2019.2.3 and the minion running 3000.

The minion function caused an exception: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1675, in _thread_return
    return_data = minion_instance.executors[fname](opts, data, func, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/executors/direct_call.py", line 12, in execute
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/modules/mysql.py", line 858, in version
    dbc = _connect(**connection_args)
  File "/usr/lib/python2.7/dist-packages/salt/modules/mysql.py", line 392, in _connect
    dbc = MySQLdb.connect(**connargs)
  File "/usr/lib/python2.7/dist-packages/pymysql/__init__.py", line 90, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 690, in __init__
    self.encoders = dict([(k, v) for (k, v) in conv.items() if type(k) is not int])
AttributeError: 'unicode' object has no attribute 'items'

@garethgreenaway garethgreenaway added this to the Blocked milestone Mar 3, 2020
@garethgreenaway garethgreenaway self-assigned this Mar 3, 2020
@garethgreenaway garethgreenaway added the Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged label Mar 3, 2020
@garethgreenaway
Copy link
Contributor

@kveroneau Thanks for the report. By default the bootstrap script will try to install the latest available version, but you can specify additional arguments that will allow it to install specific versions, https://ansible-cn.readthedocs.io/en/latest/topics/tutorials/salt_bootstrap.html, and include those arguments in the Salt cloud configuraiton, https://docs.saltstack.com/en/latest/topics/cloud/misc.html#deploy-script-arguments.

@kveroneau
Copy link
Author

kveroneau commented Mar 3, 2020

@garethgreenaway Thank you for pointing that out. I was actually searching if I could set the salt-minion version which is installed by salt-cloud, but originally had problems trying to figure out how to set the version. I think this link should be useful. I will try an orchestration of a server today in our AWS environment and see if my original issues with MySQL as mentioned in my issue persist.

Although, it would make more sense to actually default the salt-minion installation version to match what the salt-master currently has installed to avoid potential issues. I am assuming me and others who run SaltStack do not immediately upgrade to the absolute latest version of SaltStack without first confirming in a sandbox environment that our existing states do not break in the latest release.

UPDATE: I was able to edit my salt-cloud state code to use a version and it worked.

@garethgreenaway
Copy link
Contributor

@kveroneau Great! We'll consider this one resolved and consider the other request as a feature request for Salt Cloud. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
Projects
None yet
Development

No branches or pull requests

2 participants