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] Using mysql:host should not check for package/service #247

Open Yoda-BZH opened 4 years ago

Yoda-BZH commented 4 years ago

Hello,

Your setup

Formula commit hash / release tag

mysql formula at 8adfc4bb4fbb49548cf46d277a0403b89c180b1a

Versions reports (master & minion)

pillarstack with master, syndic and minion at version salt 3000.3 :

Salt Version:
           Salt: 3000.3

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.7.3
      docker-py: Not Installed
          gitdb: 2.0.5
      gitpython: 2.1.11
         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: Not Installed
         pygit2: Not Installed
         Python: 3.7.3 (default, Dec 20 2019, 18:57:59)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 17.1.2
          smmap: 2.0.5
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.1

System Versions:
           dist: debian 10.4 
         locale: UTF-8
        machine: x86_64
        release: 4.19.0-9-cloud-amd64
         system: Linux

Pillar / config used

This kind of configuration

mysql:
  server:
    # If you only manage the dbs and users and the server is on
    # another host
    host: 123.123.123.123

Bug details

Describe the bug

When using the formula to manage a remote mysql server, AWS RDS for example, the formula wants to install a local mysql server and manage it.

Steps to reproduce the bug

Use a server on a server and manage a remote mysql server, aws rds for example

Expected behaviour

No package should be installed and no service should be checked This behaviour may be automatic if mysql:host is provided, or through a special configuration

Attempts to fix the bug

A dirty way to bypass the installation is to defined server packages to another name, openssh-server for example

mysql:
  serverpkg: 'openssh-server'
  service: 'sshd'

With this, the package openssh-server will be installed, which is always installed in our setup, and service ssh/sshd will be checked, which will always be.

Additional context

One way to "fix" this behaviour would be to force serverpkg and service to empty string. If both variables are empty, no package should be installed and no service should be managed.

Thank you !