Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
5f829f99
Commit
5f829f99
authored
Feb 16, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add versionadded element to new option, fix YAML formatting
parent
2a661859
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
library/lineinfile
+5
-3
No files found.
library/lineinfile
View file @
5f829f99
...
@@ -63,15 +63,16 @@ options:
...
@@ -63,15 +63,16 @@ options:
- Used with C(state=present). If specified, the line will be inserted
- Used with C(state=present). If specified, the line will be inserted
after the specified regular expression. A special value is
after the specified regular expression. A special value is
available; C(EOF) for inserting the line at the end of the file.
available; C(EOF) for inserting the line at the end of the file.
choices: [
EOF, *regex*
]
choices: [
'EOF', '*regex*'
]
insertbefore:
insertbefore:
required: false
required: false
versionadded: 1.1
description:
description:
- Used with C(state=present). If specified, the line will be inserted
- Used with C(state=present). If specified, the line will be inserted
before the specified regular expression. A value is available;
before the specified regular expression. A value is available;
C(BOF) for inserting the line at the beginning of the
C(BOF) for inserting the line at the beginning of the
file.
file.
choices: [
BOF, *regex*
]
choices: [
'BOF', '*regex*'
]
create:
create:
required: false
required: false
choices: [ yes, no ]
choices: [ yes, no ]
...
@@ -88,11 +89,12 @@ options:
...
@@ -88,11 +89,12 @@ options:
get the original file back if you somehow clobbered it incorrectly.
get the original file back if you somehow clobbered it incorrectly.
examples:
examples:
- code: 'lineinfile: dest=/etc/selinux/config regexp=^SELINUX= line=SELINUX=disabled'
- code: 'lineinfile: dest=/etc/selinux/config regexp=^SELINUX= line=SELINUX=disabled'
- 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/sudoers state=absent regexp="^
%
wheel"'
- code: 'lineinfile: dest=/etc/httpd/conf/httpd.conf regexp="^Listen " insertafter="^#Listen " line="Listen 8080"'
- code: 'lineinfile: dest=/etc/httpd/conf/httpd.conf regexp="^Listen " insertafter="^#Listen " line="Listen 8080"'
- code: 'lineinfile: dest=/etc/services regexp="^# port for http" insertbefore="^www.*80/tcp" line="# port for http by default"'
- code: 'lineinfile: dest=/etc/services regexp="^# port for http" insertbefore="^www.*80/tcp" line="# port for http by default"'
- code: "lineinfile:
\\\"
dest=/etc/sudoers state=present regexp='^
%
wheel' line ='
%
wheel ALL=(ALL) NOPASSWD: ALL'
\\\"
"
"""
"""
def
present
(
module
,
dest
,
regexp
,
line
,
insertafter
,
insertbefore
,
create
,
backup
):
def
present
(
module
,
dest
,
regexp
,
line
,
insertafter
,
insertbefore
,
create
,
backup
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment