title: Ansible: insert a single word on an existing line in a file
body: <p>I have to use Ansible modules in order to edit the /etc/ssh/sshd_config file - every time I create a new user I want to append it at these two lines:</p>
  
  <pre><code>AllowUsers root osadmin &lt;new_user&gt;
  AllowGroups root staff &lt;new_group&gt;
  </code></pre>
  
  <p>At this moment I'm using the shell module to execute a sed command but would like to use lineinfile, if possible</p>
  
  <pre><code>- shell: "sed -i '/^Allow/ s/$/ {{ user_name }}/' /etc/ssh/sshd_config"
  </code></pre>
  
  <p>Any suggestions would be sincerely appreciated.</p>