saltstack-formulas/mysql-formula

Fails if FQDN is localhost or localhost.localdomain

aidanharris opened this issue · 0 comments

> salt-call state.apply mysql.server  
[CRITICAL] Rendering SLS 'base:mysql.server' failed: Conflicting ID 'mysql_delete_anonymous_user_localhost.localdomain'
local:
    Data failed to compile:
----------
    Rendering SLS 'base:mysql.server' failed: Conflicting ID 'mysql_delete_anonymous_user_localhost.localdomain'

See mysql/server.sls:

{% for host in ['localhost', 'localhost.localdomain', salt['grains.get']('fqdn')] %}
mysql_delete_anonymous_user_{{ host }}:
  mysql_user:
    - absent
    - host: {{ host or "''" }}
    - name: ''
    - connection_host: '{{ mysql_host }}'
    - connection_user: '{{ mysql_salt_user }}'
    {% if mysql_salt_password %}
    - connection_pass: '{{ mysql_salt_password }}'
    {% endif %}
    - connection_charset: utf8
    - require:
      - service: mysqld
      - pkg: mysql_python
      {%- if (mysql_salt_user == mysql_root_user) and mysql_root_password %}
      - cmd: mysql_root_password
      {%- endif %}
{% endfor %}