title: adding an fstab option using Ansible
body: <p>I am trying to add nodev to my <code>/etc/fstab</code> file. I am using the Ansible command below but with no luck. My issue lies with the regular expression, I'm not a pro at regex.</p>
  
  <pre><code>- name: Add nodev to /etc/fstab
    lineinfile:
      dest=/etc/fstab
      backup=yes
      backrefs=yes
      state=present
      regexp='(^/dev[\w/_-]+(\s+(?!nodev)[\w,]+)*)'
      line='\1,nodev'
  </code></pre>
  
  <p>One of the lines from <code>/etc/fstab</code> that I am trying to add <code>nodev</code> is:</p>
  
  <pre><code>/dev/mapper/ex_sys-ex_home /home /ext4 rw,exec,auto,nouser,sync 1 2
  </code></pre>