From b5adbfbef4c4b21db702e4e7bac8097deb98725b Mon Sep 17 00:00:00 2001 From: Hubert Feyrer Date: Wed, 13 Feb 2013 21:42:12 +0100 Subject: [PATCH 1/2] Add an example on how to *add* a %wheel line to sudo - tricky as it has a colon, which needs some special attention. --- lineinfile | 1 + 1 file changed, 1 insertion(+) diff --git a/lineinfile b/lineinfile index fbe65239383..f47a6ea8314 100644 --- a/lineinfile +++ b/lineinfile @@ -82,6 +82,7 @@ options: get the original file back if you somehow clobbered it incorrectly. examples: - code: 'lineinfile: dest=/etc/selinux/config regexp=^SELINUX= line=SELINUX=disabled' + - code: "lineinfile: \\\"dest=/usr/pkg/etc/sudoers state=present regexp='^%wheel' line ='%wheel ALL=(ALL) NOPASSWD: ALL'\\\"" - code: 'lineinfile: dest=/etc/sudoers state=absent regexp="^%wheel"' - code: 'lineinfile: dest=/etc/httpd/conf/httpd.conf regexp="^Listen " insertafter="^#Listen " line="Listen 8080"' """ From 401d67a8ba86f203b3bad05c91fd5f13e26536d0 Mon Sep 17 00:00:00 2001 From: Hubert Feyrer Date: Wed, 13 Feb 2013 22:02:17 +0100 Subject: [PATCH 2/2] Add Linux-style path for sudoers file, to be consistent with other examples. --- lineinfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lineinfile b/lineinfile index f47a6ea8314..6378e774c4a 100644 --- a/lineinfile +++ b/lineinfile @@ -82,7 +82,7 @@ options: get the original file back if you somehow clobbered it incorrectly. examples: - code: 'lineinfile: dest=/etc/selinux/config regexp=^SELINUX= line=SELINUX=disabled' - - code: "lineinfile: \\\"dest=/usr/pkg/etc/sudoers state=present regexp='^%wheel' line ='%wheel ALL=(ALL) NOPASSWD: ALL'\\\"" + - code: "lineinfile: \\\"dest=/etc/sudoers state=present regexp='^%wheel' line ='%wheel ALL=(ALL) NOPASSWD: ALL'\\\"" - code: 'lineinfile: dest=/etc/sudoers state=absent regexp="^%wheel"' - code: 'lineinfile: dest=/etc/httpd/conf/httpd.conf regexp="^Listen " insertafter="^#Listen " line="Listen 8080"' """