title: check and add multiple lines in puppet
body: <p>I need to ensure through puppet that the file <code>/etc/logrotate.conf</code> must have the entry </p>
  
  <pre><code>/var/log/secure {
      monthly
      rotate 11
  }
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>$line_string = "/var/log/secure {
      monthly
      rotate 11
  }"
  
  file_line {'ensure correct entry in /etc/logrotate.conf':
    path  =&gt; '/etc/logrotate.conf',
    line  =&gt; $line_string,
    match =&gt; $line_string,
  }
  </code></pre>
  
  <p>It creates the entry the first time, but when I apply the puppet code a second time it adds the entry again</p>
  
  <pre><code>[~] # puppet apply /home/vijay/logrot.pp
  Notice: Compiled catalog for lxv9824 in environment production in 0.10 seconds
  /var/lib/puppet/lib/puppet/provider/file_line/ruby.rb:36: warning: regexp has invalid interval
  /var/lib/puppet/lib/puppet/provider/file_line/ruby.rb:36: warning: regexp has `}' without escape
  Notice: /Stage[main]/Main/File_line[ensure correct entry in /etc/logrotate.conf]/ensure: created
  Notice: Finished catalog run in 0.06 seconds
  
  [~] # more /etc/logrotate.conf
  /var/log/secure {
      monthly
      rotate 11
  }
  /var/log/secure {
      monthly
      rotate 11
  }
  </code></pre>
  
  <p>How can I prevent puppet from adding the entry a second time?</p>