title: How to grant MySQL server administration privileges (SUPER, RELOAD...) with ansible?
body: <p>Is there a way how to grant MySQL administration privileges using Ansible mysql_user module (or using any other module)? I want to set <code>SUPER</code>, <code>RELOAD</code> and <code>SHOW DATABASES</code> privileges to the user along with some other database-specific privs.</p>
  
  <p>Following <em>basic</em> setup works well for me:</p>
  
  <pre><code>- name: Set user privileges
    mysql_user:
      user={{ mysql_user }}
      password={{ mysql_password }}
      state=present
      priv={{ item }}
    with_items:
      - 'somedatabase.*:ALL'
      - 'someotherdatabase.*:ALL'
  </code></pre>
  
  <p>...results in:</p>
  
  <pre><code>TASK: [db | Set user privileges]
  **********************************************
  ok: [dbuser] =&gt; (item=somedatabase.*:ALL)
  ok: [dbuser] =&gt; (item=someotherdatabase.*:ALL)
  </code></pre>
  
  <hr>
  
  <p>Following setup keeps saying "changed" and the privileges are not what one would expect:</p>
  
  <pre><code>- name: Set user privileges
    mysql_user:
      user={{ mysql_user }}
      password={{ mysql_password }}
      state=present
      priv={{ item }}
    with_items:
      - '*.*:SUPER,RELOAD,SHOW\ DATABASES'
      - 'somedatabase.*:ALL'
      - 'someotherdatabase.*:ALL'
  </code></pre>
  
  <p>(repeated) run:</p>
  
  <pre><code>TASK: [db | Set user privileges]
  **********************************************
  changed: [dbuser] =&gt; (item=*.*:SUPER,RELOAD,SHOW\ DATABASES)
  changed: [dbuser] =&gt; (item=somedatabase.*:ALL)
  ok: [dbuser] =&gt; (item=someotherdatabase.*:ALL)
  </code></pre>
  
  <p>results in:</p>
  
  <pre><code>mysql&gt; show grants for 'dbuser'@'localhost';
  +---------------------------------------------------------------------------------------------------------------+
  | Grants for dbuser@localhost                                                                                   |
  +---------------------------------------------------------------------------------------------------------------+
  | GRANT USAGE ON *.* TO 'dbuser'@'localhost' IDENTIFIED BY PASSWORD '*2046D2DDAE359F311435E8B4D3776EFE13FB584C' |
  | GRANT ALL PRIVILEGES ON `somedatabase`.* TO 'dbuser'@'localhost'                                              |
  | GRANT ALL PRIVILEGES ON `someotherdatabase`.* TO 'dbuser'@'localhost'                                         |
  +---------------------------------------------------------------------------------------------------------------+
  3 rows in set (0.00 sec)
  </code></pre>
  
  <p>Does anyone know how to:</p>
  
  <ol>
  <li>set <code>SUPER</code>, <code>RELOAD</code> and <code>SHOW DATABASE</code> admin. privileges?</li>
  <li>make the configuration idempotent?</li>
  </ol>