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
57372906
Commit
57372906
authored
Oct 02, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pull host/group vars when adding hosts/groups
Fixes #12582
parent
aa3687d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletions
+3
-1
lib/ansible/inventory/__init__.py
+1
-1
lib/ansible/plugins/strategy/__init__.py
+2
-0
No files found.
lib/ansible/inventory/__init__.py
View file @
57372906
...
...
@@ -677,7 +677,7 @@ class Inventory(object):
# this can happen from particular API usages, particularly if not run
# from /usr/bin/ansible-playbook
if
basedir
i
s
None
:
if
basedir
i
n
(
''
,
None
)
:
basedir
=
'./'
scan_pass
=
scan_pass
+
1
...
...
lib/ansible/plugins/strategy/__init__.py
View file @
57372906
...
...
@@ -327,6 +327,7 @@ class StrategyBase:
# Set/update the vars for this host
# FIXME: probably should have a set vars method for the host?
new_vars
=
host_info
.
get
(
'host_vars'
,
dict
())
new_host
.
vars
=
self
.
_inventory
.
get_host_vars
(
new_host
)
new_host
.
vars
.
update
(
new_vars
)
new_groups
=
host_info
.
get
(
'groups'
,
[])
...
...
@@ -379,6 +380,7 @@ class StrategyBase:
# create the new group and add it to inventory
new_group
=
Group
(
name
=
group_name
)
self
.
_inventory
.
add_group
(
new_group
)
new_group
.
vars
=
self
.
_inventory
.
get_group_vars
(
new_group
)
# and add the group to the proper hierarchy
allgroup
=
self
.
_inventory
.
get_group
(
'all'
)
...
...
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