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
292ac4aa
Commit
292ac4aa
authored
Mar 23, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it such that the 'name' element of each playbook line is optional.
parent
44d4dede
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
examples/playbooks/user_commands.yml
+5
-7
lib/ansible/playbook.py
+6
-2
No files found.
examples/playbooks/user_commands.yml
View file @
292ac4aa
...
...
@@ -15,11 +15,9 @@
-
name
:
test basic user account creation
action
:
user name=tset comment=TsetUser gid=100 shell=/sbin/nologin createhome=no
-
name
:
test user account modification
action
:
user name=tset comment=NyetUser
# the following is just a simple example of how you don't have to include
# the 'name' element for each task
-
name
:
test user account password change
action
:
user name=tset password=$password
-
name
:
test user account modification
action
:
user name=tset state=absent
-
action
:
user name=tset comment=NyetUser
-
action
:
user name=tset password=$password
-
action
:
user name=tset state=absent
lib/ansible/playbook.py
View file @
292ac4aa
...
...
@@ -336,8 +336,12 @@ class PlayBook(object):
host_list
=
self
.
_prune_failed_hosts
(
host_list
)
# load the module name and parameters from the task entry
name
=
task
[
'name'
]
# FIXME: error if not set
action
=
task
[
'action'
]
# FIXME: error if not set
name
=
task
.
get
(
'name'
,
None
)
action
=
task
.
get
(
'action'
,
None
)
if
action
is
None
:
raise
errors
.
AnsibleError
(
"action is required for each item in tasks"
)
if
name
is
None
:
name
=
action
only_if
=
task
.
get
(
'only_if'
,
'True'
)
async_seconds
=
int
(
task
.
get
(
'async'
,
0
))
# not async by default
async_poll_interval
=
int
(
task
.
get
(
'poll'
,
10
))
# default poll = 10 seconds
...
...
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