title: Writing a string to file using Ad-Hoc Commands in Ansible
body: <p>I'm a beginner with Ansible and trying to write a string to a file with an <strong>Ad-Hoc command</strong> I'm trying to play around with the <code>replace</code> module. The file I'm trying to write to is <code>/etc/motd/</code>.</p>
  
  <pre><code>ansible replace --sudo /etc/motd "This server is managed by Ansible"
  </code></pre>
  
  <p>Any help would be appreciated thanks!</p>