title: Puppet and mysql: revoke and repeat
body: <h1>Grant: this works</h1>
  
  <p>I have the following puppet code:</p>
  
  <pre><code>mysql_grant {'my-user-name@1.2.3.4/my-database-name.*':
    ensure     =&gt; 'present',
    options    =&gt; ['GRANT'],
    privileges =&gt; ['SELECT', 'INSERT', 'DELETE', 'UPDATE'],
    table      =&gt; 'my-database-name.*',
    user       =&gt; 'my-user-name@1.2.3.4',
  }
  </code></pre>
  
  <p>and that does grant the permissions I expect.</p>
  
  <h1>Revoke: this doesn't work</h1>
  
  <p>If I change my mind and say this:</p>
  
  <pre><code>mysql_grant {'my-user-name@1.2.3.4/my-database-name.*':
    ensure     =&gt; 'absent',
    options    =&gt; ['GRANT'],
    privileges =&gt; ['SELECT', 'INSERT', 'DELETE', 'UPDATE'],
    table      =&gt; 'my-database-name.*',
    user       =&gt; 'my-user-name@1.2.3.4',
  }
  </code></pre>
  
  <p>I note that it doesn't revoke permission (not even if I change s/GRANT/REVOKE/).  Any pointers on how to automate revocation?  I haven't been able to find it in the manual or by googling.</p>
  
  <h1>Repeat: I'm lost without copy and paste</h1>
  
  <p>Now suppose I want to permit access from several hosts. My puppet-fu fails me on how to not repeat the block (i.e., just copy-paste with different IP addresses).  I'm sure puppet defines tools for this, but I've not figured out that part yet.</p>
  
  <p>Thanks for any pointers!</p>