{"action":"closed","number":13371,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/13371","id":52247414,"html_url":"https://github.com/ansible/ansible/pull/13371","diff_url":"https://github.com/ansible/ansible/pull/13371.diff","patch_url":"https://github.com/ansible/ansible/pull/13371.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/13371","number":13371,"state":"closed","locked":false,"title":"fix sorting of groups for host vars","user":{"login":"larsla","id":697688,"avatar_url":"https://avatars.githubusercontent.com/u/697688?v=3","gravatar_id":"","url":"https://api.github.com/users/larsla","html_url":"https://github.com/larsla","followers_url":"https://api.github.com/users/larsla/followers","following_url":"https://api.github.com/users/larsla/following{/other_user}","gists_url":"https://api.github.com/users/larsla/gists{/gist_id}","starred_url":"https://api.github.com/users/larsla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsla/subscriptions","organizations_url":"https://api.github.com/users/larsla/orgs","repos_url":"https://api.github.com/users/larsla/repos","events_url":"https://api.github.com/users/larsla/events{/privacy}","received_events_url":"https://api.github.com/users/larsla/received_events","type":"User","site_admin":false},"body":"found this issue because we're using the hierarchy of groups to specify values on different levels.\r\n\r\nhow to validate fix:\r\n```\r\ncat >inventory <<EOF\r\n[top:children]\r\nlower\r\n\r\n[lower]\r\nhost01\r\nEOF\r\n\r\nmkdir group_vars\r\ncat >group_vars/top <<EOF\r\n---\r\nmy_var: \"shouldn't be used\"\r\nEOF\r\n\r\ncat >group_vars/lower <<EOF\r\n---\r\nmy_var: \"this one should be used\"\r\nEOF\r\n\r\ncat >playbook.yml <<EOF\r\n- hosts: all\r\n  connection: local\r\n  sudo: no\r\n  tasks:\r\n    - debug: msg=\"{{ my_var }}\"\r\nEOF\r\n\r\nansible-playbook -i inventory playbook.yml\r\n```\r\n\r\ncompare result from ansible 2.0 devel and my fork to see difference\r\n\r\nlog:\r\n\r\n```\r\n(venv)$ pip install git+https://github.com/ansible/ansible.git\r\nCollecting git+https://github.com/ansible/ansible.git\r\n  Cloning https://github.com/ansible/ansible.git to /var/folders/y_/l6hg282s1636jt3ggm75dlrr0000gn/T/pip-72FUSu-build\r\nCollecting paramiko (from ansible==2.0.0)\r\n/Users/lars/tmp/ver/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#in\r\nsecureplatformwarning.\r\n  InsecurePlatformWarning\r\n  Using cached paramiko-1.16.0-py2.py3-none-any.whl\r\nCollecting jinja2 (from ansible==2.0.0)\r\n  Using cached Jinja2-2.8-py2.py3-none-any.whl\r\nCollecting PyYAML (from ansible==2.0.0)\r\nRequirement already satisfied (use --upgrade to upgrade): setuptools in ./venv/lib/python2.7/site-packages (from ansible==2.0.0)\r\nCollecting pycrypto>=2.6 (from ansible==2.0.0)\r\nCollecting ecdsa>=0.11 (from paramiko->ansible==2.0.0)\r\n  Using cached ecdsa-0.13-py2.py3-none-any.whl\r\nCollecting MarkupSafe (from jinja2->ansible==2.0.0)\r\nInstalling collected packages: ecdsa, pycrypto, paramiko, MarkupSafe, jinja2, PyYAML, ansible\r\n  Running setup.py install for ansible\r\nSuccessfully installed MarkupSafe-0.23 PyYAML-3.11 ansible-2.0.0 ecdsa-0.13 jinja2-2.8 paramiko-1.16.0 pycrypto-2.6.1\r\n/Users/lars/tmp/ver/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#in\r\nsecureplatformwarning.\r\n  InsecurePlatformWarning\r\n(venv)$ ansible-playbook -i inventory playbook.yml\r\n[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and make sure become_method is 'sudo' (default). This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.\r\n\r\nPLAY ***************************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nok: [host01]\r\n\r\nTASK [debug msg={{ my_var }}] **************************************************\r\nok: [host01] => {\r\n    \"changed\": false,\r\n    \"msg\": \"shouldn't be used\"\r\n}\r\n\r\nPLAY RECAP *********************************************************************\r\nhost01                     : ok=2    changed=0    unreachable=0    failed=0\r\n\r\n(venv)$ pip install -U git+https://github.com/larsla/ansible.git\r\nCollecting git+https://github.com/larsla/ansible.git\r\n  Cloning https://github.com/larsla/ansible.git to /var/folders/y_/l6hg282s1636jt3ggm75dlrr0000gn/T/pip-Zn8Aay-build\r\nRequirement already up-to-date: paramiko in ./venv/lib/python2.7/site-packages (from ansible==2.0.0)\r\nRequirement already up-to-date: jinja2 in ./venv/lib/python2.7/site-packages (from ansible==2.0.0)\r\nRequirement already up-to-date: PyYAML in ./venv/lib/python2.7/site-packages (from ansible==2.0.0)\r\n/Users/lars/tmp/ver/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.\r\n  InsecurePlatformWarning\r\nCollecting setuptools (from ansible==2.0.0)\r\n  Using cached setuptools-18.7-py2.py3-none-any.whl\r\nRequirement already up-to-date: pycrypto>=2.6 in ./venv/lib/python2.7/site-packages (from ansible==2.0.0)\r\nRequirement already up-to-date: ecdsa>=0.11 in ./venv/lib/python2.7/site-packages (from paramiko->ansible==2.0.0)\r\nRequirement already up-to-date: MarkupSafe in ./venv/lib/python2.7/site-packages (from jinja2->ansible==2.0.0)\r\nInstalling collected packages: setuptools, ansible\r\n  Found existing installation: setuptools 18.2\r\n    Uninstalling setuptools-18.2:\r\n      Successfully uninstalled setuptools-18.2\r\n  Found existing installation: ansible 2.0.0\r\n    Uninstalling ansible-2.0.0:\r\n      Successfully uninstalled ansible-2.0.0\r\n  Running setup.py install for ansible\r\nSuccessfully installed ansible-2.0.0 setuptools-18.7\r\n\r\n(venv)$ ansible-playbook -i inventory playbook.yml\r\n[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and make sure become_method is 'sudo' (default). This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.\r\n\r\nPLAY ***************************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nok: [host01]\r\n\r\nTASK [debug msg={{ my_var }}] **************************************************\r\nok: [host01] => {\r\n    \"changed\": false,\r\n    \"msg\": \"this one should be used\"\r\n}\r\n\r\nPLAY RECAP *********************************************************************\r\nhost01                     : ok=2    changed=0    unreachable=0    failed=0\r\n```","created_at":"2015-12-01T11:40:31Z","updated_at":"2015-12-03T19:24:06Z","closed_at":"2015-12-03T19:24:06Z","merged_at":null,"merge_commit_sha":"c4dc1b7a339f4a8d30211bab3a1809a9fd5c634f","assignee":null,"milestone":{"url":"https://api.github.com/repos/ansible/ansible/milestones/5","html_url":"https://github.com/ansible/ansible/milestones/v2","labels_url":"https://api.github.com/repos/ansible/ansible/milestones/5/labels","id":975800,"number":5,"title":"v2","description":null,"creator":{"login":"bcoca","id":836171,"avatar_url":"https://avatars.githubusercontent.com/u/836171?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoca","html_url":"https://github.com/bcoca","followers_url":"https://api.github.com/users/bcoca/followers","following_url":"https://api.github.com/users/bcoca/following{/other_user}","gists_url":"https://api.github.com/users/bcoca/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoca/subscriptions","organizations_url":"https://api.github.com/users/bcoca/orgs","repos_url":"https://api.github.com/users/bcoca/repos","events_url":"https://api.github.com/users/bcoca/events{/privacy}","received_events_url":"https://api.github.com/users/bcoca/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":560,"state":"open","created_at":"2015-02-11T19:43:06Z","updated_at":"2015-12-03T19:24:06Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/13371/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/13371/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/13371/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/a20f48dd2c5c647496aef9cfb65ec29c15e7df54","head":{"label":"larsla:devel","ref":"devel","sha":"a20f48dd2c5c647496aef9cfb65ec29c15e7df54","user":{"login":"larsla","id":697688,"avatar_url":"https://avatars.githubusercontent.com/u/697688?v=3","gravatar_id":"","url":"https://api.github.com/users/larsla","html_url":"https://github.com/larsla","followers_url":"https://api.github.com/users/larsla/followers","following_url":"https://api.github.com/users/larsla/following{/other_user}","gists_url":"https://api.github.com/users/larsla/gists{/gist_id}","starred_url":"https://api.github.com/users/larsla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsla/subscriptions","organizations_url":"https://api.github.com/users/larsla/orgs","repos_url":"https://api.github.com/users/larsla/repos","events_url":"https://api.github.com/users/larsla/events{/privacy}","received_events_url":"https://api.github.com/users/larsla/received_events","type":"User","site_admin":false},"repo":{"id":47184879,"name":"ansible","full_name":"larsla/ansible","owner":{"login":"larsla","id":697688,"avatar_url":"https://avatars.githubusercontent.com/u/697688?v=3","gravatar_id":"","url":"https://api.github.com/users/larsla","html_url":"https://github.com/larsla","followers_url":"https://api.github.com/users/larsla/followers","following_url":"https://api.github.com/users/larsla/following{/other_user}","gists_url":"https://api.github.com/users/larsla/gists{/gist_id}","starred_url":"https://api.github.com/users/larsla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsla/subscriptions","organizations_url":"https://api.github.com/users/larsla/orgs","repos_url":"https://api.github.com/users/larsla/repos","events_url":"https://api.github.com/users/larsla/events{/privacy}","received_events_url":"https://api.github.com/users/larsla/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/larsla/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":true,"url":"https://api.github.com/repos/larsla/ansible","forks_url":"https://api.github.com/repos/larsla/ansible/forks","keys_url":"https://api.github.com/repos/larsla/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/larsla/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/larsla/ansible/teams","hooks_url":"https://api.github.com/repos/larsla/ansible/hooks","issue_events_url":"https://api.github.com/repos/larsla/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/larsla/ansible/events","assignees_url":"https://api.github.com/repos/larsla/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/larsla/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/larsla/ansible/tags","blobs_url":"https://api.github.com/repos/larsla/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/larsla/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/larsla/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/larsla/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/larsla/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/larsla/ansible/languages","stargazers_url":"https://api.github.com/repos/larsla/ansible/stargazers","contributors_url":"https://api.github.com/repos/larsla/ansible/contributors","subscribers_url":"https://api.github.com/repos/larsla/ansible/subscribers","subscription_url":"https://api.github.com/repos/larsla/ansible/subscription","commits_url":"https://api.github.com/repos/larsla/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/larsla/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/larsla/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/larsla/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/larsla/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/larsla/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/larsla/ansible/merges","archive_url":"https://api.github.com/repos/larsla/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/larsla/ansible/downloads","issues_url":"https://api.github.com/repos/larsla/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/larsla/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/larsla/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/larsla/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/larsla/ansible/labels{/name}","releases_url":"https://api.github.com/repos/larsla/ansible/releases{/id}","created_at":"2015-12-01T11:23:20Z","updated_at":"2015-12-01T11:23:28Z","pushed_at":"2015-12-01T15:09:43Z","git_url":"git://github.com/larsla/ansible.git","ssh_url":"git@github.com:larsla/ansible.git","clone_url":"https://github.com/larsla/ansible.git","svn_url":"https://github.com/larsla/ansible","homepage":"http://ansible.com/","size":37252,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"ba4e571029be059f80e8b4aab4da7578c6120e39","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","created_at":"2012-03-06T14:58:02Z","updated_at":"2015-12-03T18:58:51Z","pushed_at":"2015-12-03T19:23:40Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"http://ansible.com/","size":51440,"stargazers_count":14055,"watchers_count":14055,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4159,"mirror_url":null,"open_issues_count":900,"forks":4159,"open_issues":900,"watchers":14055,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/13371"},"html":{"href":"https://github.com/ansible/ansible/pull/13371"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/13371"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/13371/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/13371/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/13371/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/a20f48dd2c5c647496aef9cfb65ec29c15e7df54"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":3,"review_comments":0,"commits":3,"additions":2,"deletions":3,"changed_files":1}}