{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/11975","labels_url":"https://api.github.com/repos/ansible/ansible/issues/11975/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/11975/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/11975/events","html_url":"https://github.com/ansible/ansible/pull/11975","id":101272864,"number":11975,"title":"Add become support for OpenBSD doas","user":{"login":"mutemule","id":305329,"avatar_url":"https://avatars.githubusercontent.com/u/305329?v=3","gravatar_id":"","url":"https://api.github.com/users/mutemule","html_url":"https://github.com/mutemule","followers_url":"https://api.github.com/users/mutemule/followers","following_url":"https://api.github.com/users/mutemule/following{/other_user}","gists_url":"https://api.github.com/users/mutemule/gists{/gist_id}","starred_url":"https://api.github.com/users/mutemule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mutemule/subscriptions","organizations_url":"https://api.github.com/users/mutemule/orgs","repos_url":"https://api.github.com/users/mutemule/repos","events_url":"https://api.github.com/users/mutemule/events{/privacy}","received_events_url":"https://api.github.com/users/mutemule/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/feature_pull_request","name":"feature_pull_request","color":"009800"},{"url":"https://api.github.com/repos/ansible/ansible/labels/needs_revision","name":"needs_revision","color":"eb6450"},{"url":"https://api.github.com/repos/ansible/ansible/labels/P2","name":"P2","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-16T14:58:24Z","updated_at":"2015-08-18T01:01:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/11975","html_url":"https://github.com/ansible/ansible/pull/11975","diff_url":"https://github.com/ansible/ansible/pull/11975.diff","patch_url":"https://github.com/ansible/ansible/pull/11975.patch"},"body":"This adds a new become_method `doas`, to support OpenBSD's `doas`.\r\n\r\nThere are a few things about this that I'm not a big fan of, but I couldn't see a cleaner way to do this:\r\n\r\n1. `doas` treats its first argument as the command to execute, so we can't `doas \"FOO=BAR python /path/to/python/script\"`; this will fail, as there is no binary called `FOO=BAR python /path/to/python/script`.\r\n2. Similarly, environment variables aren't commands. As far as I can tell, `ansible` always starts a command by setting environment variables, so this patch makes the assumption that this is always the case. This seemed easier and less fragile than trying to parse `cmd` to determine if environment variables were, in fact, being set. Perhaps this can be made safer with `.... env ANSIBLE=TRUE %s`?\r\n\r\nOverall, it's pretty rudimentary (and still requires modifications to [ansible-modules-core/commands/command.py](https://github.com/ansible/ansible-modules-core/blob/devel/commands/command.py#L146)), but it's at least functional on my system.\r\n\r\nfixes #11972"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/132010693","html_url":"https://github.com/ansible/ansible/pull/11975#issuecomment-132010693","issue_url":"https://api.github.com/repos/ansible/ansible/issues/11975","id":132010693,"user":{"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},"created_at":"2015-08-18T01:01:13Z","updated_at":"2015-08-18T01:01:13Z","body":"need to remove the v1 changes from the PR"}}