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
e3e97f6e
Commit
e3e97f6e
authored
Mar 20, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now correctly aplies add_host passed variables last to override existing vars.
parent
6dca95b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
lib/ansible/runner/action_plugins/add_host.py
+5
-6
test/integration/unicode.yml
+6
-0
No files found.
lib/ansible/runner/action_plugins/add_host.py
View file @
e3e97f6e
...
...
@@ -69,12 +69,6 @@ class ActionModule(object):
inventory
.
_hosts_cache
[
new_name
]
=
new_host
allgroup
.
add_host
(
new_host
)
# Add any variables to the new_host
for
k
in
args
.
keys
():
if
not
k
in
[
'name'
,
'hostname'
,
'groupname'
,
'groups'
]:
new_host
.
set_variable
(
k
,
args
[
k
])
groupnames
=
args
.
get
(
'groupname'
,
args
.
get
(
'groups'
,
args
.
get
(
'group'
,
''
)))
# add it to the group if that was specified
if
groupnames
:
...
...
@@ -100,6 +94,11 @@ class ActionModule(object):
# actually load host vars
new_host
.
vars
=
inventory
.
get_host_variables
(
new_name
,
update_cached
=
True
,
vault_password
=
inventory
.
_vault_password
)
# Add any passed variables to the new_host
for
k
in
args
.
keys
():
if
not
k
in
[
'name'
,
'hostname'
,
'groupname'
,
'groups'
]:
new_host
.
set_variable
(
k
,
args
[
k
])
result
[
'new_host'
]
=
new_name
# clear pattern caching completely since it's unpredictable what
...
...
test/integration/unicode.yml
View file @
e3e97f6e
...
...
@@ -44,6 +44,12 @@
-
name
:
'
A
play
for
hosts
in
group:
ĪīĬĭ'
hosts
:
'
ĪīĬĭ'
gather_facts
:
false
tasks
:
-
debug
:
var=hostvars[inventory_hostname]
-
name
:
'
A
play
for
hosts
in
group:
ĪīĬĭ'
hosts
:
'
ĪīĬĭ'
gather_facts
:
true
tasks
:
-
debug
:
msg='Unicode is a good thing ™'
...
...
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