saltstack-formulas / mysql-formula

Install the MySQL client and/or server
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
85 stars 369 forks source link

[BUG] Server is installed when only Client is desired #242

Closed tnelson-doghouse closed 4 years ago

tnelson-doghouse commented 4 years ago

Your setup

Formula commit hash / release tag

v0.52.7

Versions reports (master & minion)

Salt Version: Salt: 3000.3

Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: 2.6.1 docker-py: 2.5.1 gitdb: 2.0.3 gitpython: 2.1.8 Jinja2: 2.10 libgit2: Not Installed M2Crypto: Not Installed Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.5.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pycryptodome: 3.4.7 pygit2: Not Installed Python: 3.6.9 (default, Apr 18 2020, 01:56:04) python-gnupg: 0.4.1 PyYAML: 3.12 PyZMQ: 16.0.2 smmap: 2.0.3 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.2.5

System Versions: dist: Ubuntu 18.04 bionic locale: UTF-8 machine: x86_64 release: 4.15.0-99-generic system: Linux version: Ubuntu 18.04 bionic

Pillar / config used

` include:

mysql: mysql.client `


Bug details

Describe the bug

The code above installed a mysql server. I only wanted the client. Now I have to uninstall things.

Steps to reproduce the bug

  1. Paste the config above into a state from which you are trying to include the MySQL state
  2. Run Salt
  3. Rage at salt as it installs the mysql server on all your servers (ok, for me, I was in an if clause, and it was only one server, but still)

Expected behaviour

Installs the mysql client, does not install server

Attempts to fix the bug

None so far

Additional context

Some servers need access to remote mysql stuff, and don't need servers

myii commented 4 years ago

@tnelson-doghouse Thanks for the bug report. Do you encounter the same problem if you only enable the following state?

tnelson-doghouse commented 4 years ago

I've noticed a number of problems in my bug report (including the title; thanks for fixing that). I've updated the report to:

  1. Include proper formatting with the config I used
  2. Include the information that I was attempting to use this from another state, not from a top.sls file.

Thanks for the quick response!

tnelson-doghouse commented 4 years ago

To answer your question properly, I thought the code I used above would only enable the mysql-client state. Do I need to do something additional to turn off the other states?

myii commented 4 years ago

@tnelson-doghouse It should be sufficient to use that as the include, i.e.

include:
  - mysql.client
tnelson-doghouse commented 4 years ago

Oh, that easy! Thank-you!

myii commented 4 years ago

Oh, that easy! Thank-you!

You're welcome. If it works out, please don't forget to add that as a comment and also close the issue.

myii commented 4 years ago

@tnelson-doghouse Did it work? Can this issue be closed?

tnelson-doghouse commented 4 years ago

Yes, that worked. Thanks!