{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/24333","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/24333/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/24333/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/24333/events","html_url":"https://github.com/ansible/ansible/issues/24333","id":226625126,"number":24333,"title":"Some packages installed with win_chocolatey (git/hg) are not available on command-line until log out/log in","user":{"login":"chrisvire","id":517814,"avatar_url":"https://avatars0.githubusercontent.com/u/517814?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisvire","html_url":"https://github.com/chrisvire","followers_url":"https://api.github.com/users/chrisvire/followers","following_url":"https://api.github.com/users/chrisvire/following{/other_user}","gists_url":"https://api.github.com/users/chrisvire/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisvire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisvire/subscriptions","organizations_url":"https://api.github.com/users/chrisvire/orgs","repos_url":"https://api.github.com/users/chrisvire/repos","events_url":"https://api.github.com/users/chrisvire/events{/privacy}","received_events_url":"https://api.github.com/users/chrisvire/received_events","type":"User","site_admin":false},"labels":[{"id":454885231,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.3","name":"affects_2.3","color":"5319e7","default":false},{"id":48276055,"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":54811101,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_info","name":"needs_info","color":"eb6420","default":false},{"id":636352846,"url":"https://api.github.com/repos/ansible/ansible/labels/support:curated","name":"support:curated","color":"ededed","default":false},{"id":108461331,"url":"https://api.github.com/repos/ansible/ansible/labels/windows","name":"windows","color":"777777","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-05-05T16:27:29Z","updated_at":"2017-07-04T22:49:13Z","closed_at":null,"body":"\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the module/plugin/task/feature -->\r\nwin_chocolatey\r\n\r\n##### ANSIBLE VERSION\r\n```\r\n$ ansible --version\r\nansible 2.3.0.0\r\n  config file = /home/hubbard/src/ops-ansible-sites/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]\r\n```\r\n\r\n##### CONFIGURATION\r\npipelining = true\r\n \r\n##### OS / ENVIRONMENT\r\nControl Machine = Ubuntu 16.04\r\nManaged Host = Windows 7 64-bit\r\n\r\n##### SUMMARY\r\nWhen using win_chocolatey to install some packages (git, hg), the environment is changed (going to advanced system settings -> environment, I can see that the PATH has been changed), but the commands cannot be executed in a command-line by the logged in user until the user logs out and logs in again.\r\n\r\n##### STEPS TO REPRODUCE\r\n```yaml\r\n- name: \"Packages: install version control packages\"\r\n  win_chocolatey: name={{item}}\r\n  with_items:\r\n    - git\r\n    - hg\r\n```\r\n##### EXPECTED RESULTS\r\nAfter executing the playbook, I expected the logged in user to be able to execute the commands.  \r\n\r\n##### ACTUAL RESULTS\r\nAfter executing the playbook, the commands cannot be executed from the logged in user in a a newly started cmd.exe window.  Running the path command doesn't display the updated PATH. \r\n\r\nIf I start a cmd.exe with \"Run As Administrator\" and run the path command, then the correct PATH environment variable is displayed.\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/312963809","html_url":"https://github.com/ansible/ansible/issues/24333#issuecomment-312963809","issue_url":"https://api.github.com/repos/ansible/ansible/issues/24333","id":312963809,"user":{"login":"jborean93","id":8462645,"avatar_url":"https://avatars0.githubusercontent.com/u/8462645?v=3","gravatar_id":"","url":"https://api.github.com/users/jborean93","html_url":"https://github.com/jborean93","followers_url":"https://api.github.com/users/jborean93/followers","following_url":"https://api.github.com/users/jborean93/following{/other_user}","gists_url":"https://api.github.com/users/jborean93/gists{/gist_id}","starred_url":"https://api.github.com/users/jborean93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jborean93/subscriptions","organizations_url":"https://api.github.com/users/jborean93/orgs","repos_url":"https://api.github.com/users/jborean93/repos","events_url":"https://api.github.com/users/jborean93/events{/privacy}","received_events_url":"https://api.github.com/users/jborean93/received_events","type":"User","site_admin":false},"created_at":"2017-07-04T22:49:13Z","updated_at":"2017-07-04T22:49:13Z","body":"For logged in users there is nothing we can really do unfortunately as that's the way Windows works. This is an issue as there is notify process that can be run that tells a logged in profile to reload the environment. I'm surprised that opening up a new cmd instance doesn't load the new environment variables so I'll have a look and see if I can reproduce it on my end.\r\n\r\nFor Ansible everytime we run a new task a new shell is created so it will inherit the latest environment variables like @jhawkesworth has shown. "}}
{"actor":{"display_login":"jborean93"}}