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
d158ec38
Commit
d158ec38
authored
11 years ago
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding new test for hash behavior (merge vs. replace)
parent
bc659567
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
131 additions
and
2 deletions
+131
-2
tests_new/integration/Makefile
+4
-1
tests_new/integration/group_vars/all
+2
-0
tests_new/integration/group_vars/local
+2
-0
tests_new/integration/host_vars/all
+0
-1
tests_new/integration/host_vars/testhost
+2
-0
tests_new/integration/roles/test_hash_behavior/defaults/main.yml
+21
-0
tests_new/integration/roles/test_hash_behavior/meta/main.yml
+18
-0
tests_new/integration/roles/test_hash_behavior/tasks/main.yml
+38
-0
tests_new/integration/roles/test_hash_behavior/vars/main.yml
+21
-0
tests_new/integration/test_hash.yml
+20
-0
tests_new/integration/vars/test_hash_vars.yml
+3
-0
No files found.
tests_new/integration/Makefile
View file @
d158ec38
all
:
non_destructive destructive
#
amazon rackspace
all
:
non_destructive destructive
test_hash
#
amazon rackspace
non_destructive
:
ansible-playbook non_destructive.yml
-i
inventory
-e
@integration_config.yml
-v
$(TEST_FLAGS)
...
...
@@ -6,3 +6,6 @@ non_destructive:
destructive
:
ansible-playbook destructive.yml
-i
inventory
-e
@integration_config.yml
-v
$(TEST_FLAGS)
test_hash
:
ANSIBLE_HASH_BEHAVIOUR
=
replace ansible-playbook test_hash.yml
-i
inventory
-v
-e
'{"test_hash":{"extra_args":"this is an extra arg"}}'
ANSIBLE_HASH_BEHAVIOUR
=
merge ansible-playbook test_hash.yml
-i
inventory
-v
-e
'{"test_hash":{"extra_args":"this is an extra arg"}}'
This diff is collapsed.
Click to expand it.
tests_new/integration/group_vars/all
View file @
d158ec38
...
...
@@ -7,3 +7,5 @@ dos: 2
tres: 3
etest: 'from group_vars'
inventory_beats_default: 'narf'
test_hash:
group_vars_all: "this is in group_vars/all"
This diff is collapsed.
Click to expand it.
tests_new/integration/group_vars/local
View file @
d158ec38
tres: 'three'
hash_test:
group_vars_local: "this is in group_vars/local"
This diff is collapsed.
Click to expand it.
tests_new/integration/host_vars/all
deleted
100644 → 0
View file @
bc659567
etest: 'from hostvars'
This diff is collapsed.
Click to expand it.
tests_new/integration/host_vars/testhost
View file @
d158ec38
...
...
@@ -3,3 +3,5 @@ b: 2
c: 3
d: 4
role_var_beats_inventory: 'should_not_see_this'
test_hash:
host_vars_testhost: "this is in host_vars/testhost"
This diff is collapsed.
Click to expand it.
tests_new/integration/roles/test_hash_behavior/defaults/main.yml
0 → 100644
View file @
d158ec38
# test code for the hash variable behavior
# (c) 2014, James Cammarata <jcammarata@ansible.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
---
test_hash
:
default_vars
:
"
this
is
in
role
default/main.yml"
This diff is collapsed.
Click to expand it.
tests_new/integration/roles/test_hash_behavior/meta/main.yml
0 → 100644
View file @
d158ec38
# test code for the hash variable behavior
# (c) 2014, James Cammarata <jcammarata@ansible.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
This diff is collapsed.
Click to expand it.
tests_new/integration/roles/test_hash_behavior/tasks/main.yml
0 → 100644
View file @
d158ec38
# test code for the hash variable behavior
# (c) 2014, James Cammarata <jcammarata@ansible.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
-
name
:
get the hash behavior env setting
shell
:
env | grep ANSIBLE_HASH_BEHAVIOUR | cut -f2- -d'='
register
:
hash_behavior
-
name
:
debug hash behavior result
debug
:
var=hash_behavior.stdout
-
name
:
assert hash behavior is merge or replace
assert
:
that
:
-
"
hash_behavior.stdout
in
('merge',
'replace')"
-
name
:
debug test_hash var
debug
:
var=test_hash
-
name
:
assert the dictionary values match
assert
:
that
:
-
"
hash_behavior.stdout
==
'merge'
and
test_hash
==
merged_hash
or
hash_behavior.stdout
==
'replace'
and
test_hash
==
replaced_hash"
This diff is collapsed.
Click to expand it.
tests_new/integration/roles/test_hash_behavior/vars/main.yml
0 → 100644
View file @
d158ec38
# test code for the hash variable behavior
# (c) 2014, James Cammarata <jcammarata@ansible.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
---
test_hash
:
role_vars
:
"
this
is
in
role
vars/main.yml"
This diff is collapsed.
Click to expand it.
tests_new/integration/test_hash.yml
0 → 100644
View file @
d158ec38
---
-
hosts
:
testhost
vars_files
:
-
vars/test_hash_vars.yml
vars
:
test_hash
:
playbook_vars
:
"
this
is
a
playbook
variable"
replaced_hash
:
extra_args
:
"
this
is
an
extra
arg"
merged_hash
:
default_vars
:
"
this
is
in
role
default/main.yml"
extra_args
:
"
this
is
an
extra
arg"
group_vars_all
:
"
this
is
in
group_vars/all"
host_vars_testhost
:
"
this
is
in
host_vars/testhost"
playbook_vars
:
"
this
is
a
playbook
variable"
role_argument
:
"
this
is
a
role
argument
variable"
role_vars
:
"
this
is
in
role
vars/main.yml"
vars_file
:
"
this
is
in
a
vars_file"
roles
:
-
{
role
:
test_hash_behavior
,
test_hash
:
{
'
role_argument'
:
'
this
is
a
role
argument
variable'
}
}
This diff is collapsed.
Click to expand it.
tests_new/integration/vars/test_hash_vars.yml
0 → 100644
View file @
d158ec38
---
test_hash
:
vars_file
:
"
this
is
in
a
vars_file"
This diff is collapsed.
Click to expand it.
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