From aaa44f9151686c6c846c07fe41c058bc7afd9e53 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 6 Nov 2013 18:51:31 -0500 Subject: [PATCH] Add doc example for lineinfile without a regexp parameter --- library/files/lineinfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/files/lineinfile b/library/files/lineinfile index 1cfebe8766..a519c8879c 100644 --- a/library/files/lineinfile +++ b/library/files/lineinfile @@ -131,6 +131,9 @@ EXAMPLES = r""" - lineinfile: dest=/etc/services regexp="^# port for http" insertbefore="^www.*80/tcp" line="# port for http by default" +# Add a line to a file if it does not exist, without passing regexp +- lineinfile: dest=/tmp/testfile line="192.168.1.99 foo.lab.net foo" + # Fully quoted because of the ': ' on the line. See the Gotchas in the YAML docs. - lineinfile: "dest=/etc/sudoers state=present regexp='^%wheel' line='%wheel ALL=(ALL) NOPASSWD: ALL'"