{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/44705","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/44705/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/44705/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/44705/events","html_url":"https://github.com/ansible/ansible/pull/44705","id":354193321,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExMDE1MjE2","number":44705,"title":"[WIP] Added basic equivalent to PowerShell modules","user":{"login":"jborean93","id":8462645,"node_id":"MDQ6VXNlcjg0NjI2NDU=","avatar_url":"https://avatars3.githubusercontent.com/u/8462645?v=4","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},"labels":[{"id":529643857,"node_id":"MDU6TGFiZWw1Mjk2NDM4NTc=","url":"https://api.github.com/repos/ansible/ansible/labels/WIP","name":"WIP","color":"fef2c0","default":false},{"id":947190508,"node_id":"MDU6TGFiZWw5NDcxOTA1MDg=","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.7","name":"affects_2.7","color":"ededed","default":false},{"id":852590921,"node_id":"MDU6TGFiZWw4NTI1OTA5MjE=","url":"https://api.github.com/repos/ansible/ansible/labels/feature","name":"feature","color":"006b75","default":false},{"id":496359346,"node_id":"MDU6TGFiZWw0OTYzNTkzNDY=","url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":636327968,"node_id":"MDU6TGFiZWw2MzYzMjc5Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false},{"id":636352796,"node_id":"MDU6TGFiZWw2MzYzNTI3OTY=","url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false},{"id":468273802,"node_id":"MDU6TGFiZWw0NjgyNzM4MDI=","url":"https://api.github.com/repos/ansible/ansible/labels/test","name":"test","color":"0e8a16","default":false},{"id":108461331,"node_id":"MDU6TGFiZWwxMDg0NjEzMzE=","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":4,"created_at":"2018-08-27T06:18:01Z","updated_at":"2018-08-27T20:06:25Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/44705","html_url":"https://github.com/ansible/ansible/pull/44705","diff_url":"https://github.com/ansible/ansible/pull/44705.diff","patch_url":"https://github.com/ansible/ansible/pull/44705.patch"},"body":"##### SUMMARY\r\nThis is a WIP PR to start a conversation around making a replacement of `Ansible.ModuleUtils.Legacy.psm1` that covers more of what `basic.py` offers to Python modules. What I've done so far in the PR:\r\n\r\n* Supports the majority of the argument spec handling in basic.py\r\n* Better error handling in case of uncaught exceptions\r\n* Return of invocation module args\r\n* Support for no_log on individual options\r\n* Integrated logging with the Windows Event log\r\n* Expose a module object that can be passed to other module_utils so it can easily access parameters, module options\r\n* Reuse of the JSON utils in the exec_wrapper for potential future support of .NET core and finer control over the output JSON objects\r\n* 2 module `win_certificate_store` and `win_chocolatey` changed to use the newer format\r\n\r\nThings still to do:\r\n\r\n* More validation with the argument spec value, easier to debug invalid spec structures\r\n* Talk with the community around what they would like to see, more changes/features\r\n* Speed optimisations, currently it has a higher overhead than Legacy.psm1 due to there being more checks\r\n* Tests, tests, and more tests\r\n* Convert some more modules to use the new framework (maybe in another PR)\r\n* Documentation\r\n* Sanity tests to verify the argument spec matches the documentation\r\n\r\nThis is still an early draft and I'm not sure whether this will be the final form it will take. I was originally planning on having this in C# but the Runspace/C# boundary with quitting the module made that difficult.\r\n\r\n##### ISSUE TYPE\r\n - Feature Pull Request\r\n\r\n##### COMPONENT NAME\r\nPowerShell\r\n\r\n##### ANSIBLE VERSION\r\n```\r\ndevel\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/416351268","html_url":"https://github.com/ansible/ansible/pull/44705#issuecomment-416351268","issue_url":"https://api.github.com/repos/ansible/ansible/issues/44705","id":416351268,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjM1MTI2OA==","user":{"login":"dagwieers","id":388198,"node_id":"MDQ6VXNlcjM4ODE5OA==","avatar_url":"https://avatars0.githubusercontent.com/u/388198?v=4","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"created_at":"2018-08-27T20:06:25Z","updated_at":"2018-08-27T20:06:25Z","author_association":"MEMBER","body":"> With the comment around having to rewrite the module, I think that's going to be a given anyway. \r\n\r\nSure, but not just because everything needs to be re-indented. Obviously the new parameter-infrastructure requires those pieces to be adapted.\r\n\r\n> Currently we store the parameters and results locally whereas this new approach has them stored in the module object itself. When testing out the 2 modules it did require some work but that was mostly indenting the main code by 1 level and changing references of $result to $Module.result\r\n\r\nIn python we don't do this though. We don't store the results in the AnsibleModule object and pass that object around rather than the required arguments. IMO that level of abstraction doesn't make it easier for contributors. It also doesn't make it easier to run pieces of code verbatim on the target machine for testing purposes."}}
{"actor":{"display_login":"dagwieers"}}