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
faed650b
Commit
faed650b
authored
Sep 26, 2012
by
Jonathan Palley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow vars in delegate_to
parent
620accf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
lib/ansible/playbook/task.py
+8
-7
No files found.
lib/ansible/playbook/task.py
View file @
faed650b
...
@@ -50,7 +50,7 @@ class Task(object):
...
@@ -50,7 +50,7 @@ class Task(object):
self
.
name
=
ds
.
get
(
'name'
,
None
)
self
.
name
=
ds
.
get
(
'name'
,
None
)
self
.
tags
=
[
'all'
]
self
.
tags
=
[
'all'
]
self
.
register
=
ds
.
get
(
'register'
,
None
)
self
.
register
=
ds
.
get
(
'register'
,
None
)
# Both are defined
# Both are defined
if
(
'action'
in
ds
)
and
(
'local_action'
in
ds
):
if
(
'action'
in
ds
)
and
(
'local_action'
in
ds
):
raise
errors
.
AnsibleError
(
"the 'action' and 'local_action' attributes can not be used together"
)
raise
errors
.
AnsibleError
(
"the 'action' and 'local_action' attributes can not be used together"
)
...
@@ -61,17 +61,18 @@ class Task(object):
...
@@ -61,17 +61,18 @@ class Task(object):
elif
'local_action'
in
ds
:
elif
'local_action'
in
ds
:
self
.
action
=
ds
.
get
(
'local_action'
,
''
)
self
.
action
=
ds
.
get
(
'local_action'
,
''
)
self
.
delegate_to
=
'127.0.0.1'
self
.
delegate_to
=
'127.0.0.1'
self
.
transport
=
'local'
# delegate_to: localhost should use local transport
elif
(
ds
.
get
(
'delegate_to'
,
None
)
in
[
'127.0.0.1'
,
'localhost'
]):
self
.
action
=
ds
.
get
(
'action'
,
''
)
self
.
delegate_to
=
'127.0.0.1'
self
.
transport
=
'local'
else
:
else
:
self
.
action
=
ds
.
get
(
'action'
,
''
)
self
.
action
=
ds
.
get
(
'action'
,
''
)
self
.
delegate_to
=
ds
.
get
(
'delegate_to'
,
None
)
self
.
delegate_to
=
ds
.
get
(
'delegate_to'
,
None
)
self
.
transport
=
ds
.
get
(
'transport'
,
play
.
transport
)
self
.
transport
=
ds
.
get
(
'transport'
,
play
.
transport
)
# delegate_to can use variables
if
not
(
self
.
delegate_to
is
None
):
self
.
delegate_to
=
utils
.
template
(
None
,
self
.
delegate_to
,
self
.
module_vars
)
# delegate_to: localhost should use local transport
if
self
.
delegate_to
in
[
'127.0.0.1'
,
'localhost'
]:
self
.
transport
=
'local'
# notified by is used by Playbook code to flag which hosts
# notified by is used by Playbook code to flag which hosts
# need to run a notifier
# need to run a notifier
self
.
notified_by
=
[]
self
.
notified_by
=
[]
...
...
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