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
f8ea93c7
Commit
f8ea93c7
authored
Mar 19, 2014
by
Serge van Ginderachter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move inventory.set_playbook_basedir from ansible-playbook to playbook constructor
parent
cc28fd89
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
bin/ansible-playbook
+0
-3
lib/ansible/inventory/__init__.py
+2
-1
lib/ansible/playbook/__init__.py
+4
-0
No files found.
bin/ansible-playbook
View file @
f8ea93c7
...
@@ -158,9 +158,6 @@ def main(args):
...
@@ -158,9 +158,6 @@ def main(args):
# run all playbooks specified on the command line
# run all playbooks specified on the command line
for
playbook
in
args
:
for
playbook
in
args
:
# let inventory know which playbooks are using so it can know the basedirs
inventory
.
set_playbook_basedir
(
os
.
path
.
dirname
(
playbook
))
stats
=
callbacks
.
AggregateStats
()
stats
=
callbacks
.
AggregateStats
()
playbook_cb
=
callbacks
.
PlaybookCallbacks
(
verbose
=
utils
.
VERBOSITY
)
playbook_cb
=
callbacks
.
PlaybookCallbacks
(
verbose
=
utils
.
VERBOSITY
)
if
options
.
step
:
if
options
.
step
:
...
...
lib/ansible/inventory/__init__.py
View file @
f8ea93c7
...
@@ -57,7 +57,8 @@ class Inventory(object):
...
@@ -57,7 +57,8 @@ class Inventory(object):
self
.
_groups_list
=
{}
self
.
_groups_list
=
{}
self
.
_pattern_cache
=
{}
self
.
_pattern_cache
=
{}
# to be set by calling set_playbook_basedir by ansible-playbook
self
.
_inventory_basedir
=
inventory
.
basedir
()
# to be set by calling set_playbook_basedir by playbook code
self
.
_playbook_basedir
=
None
self
.
_playbook_basedir
=
None
# the inventory object holds a list of groups
# the inventory object holds a list of groups
...
...
lib/ansible/playbook/__init__.py
View file @
f8ea93c7
...
@@ -159,6 +159,10 @@ class PlayBook(object):
...
@@ -159,6 +159,10 @@ class PlayBook(object):
self
.
basedir
=
os
.
path
.
dirname
(
playbook
)
or
'.'
self
.
basedir
=
os
.
path
.
dirname
(
playbook
)
or
'.'
utils
.
plugins
.
push_basedir
(
self
.
basedir
)
utils
.
plugins
.
push_basedir
(
self
.
basedir
)
# let inventory know the playbook basedir so it can load more vars
self
.
inventory
.
set_playbook_basedir
(
self
.
basedir
)
vars
=
extra_vars
.
copy
()
vars
=
extra_vars
.
copy
()
vars
[
'playbook_dir'
]
=
self
.
basedir
vars
[
'playbook_dir'
]
=
self
.
basedir
if
self
.
inventory
.
basedir
()
is
not
None
:
if
self
.
inventory
.
basedir
()
is
not
None
:
...
...
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