{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/packer/issues/6878","repository_url":"https://api.github.com/repos/hashicorp/packer","labels_url":"https://api.github.com/repos/hashicorp/packer/issues/6878/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/packer/issues/6878/comments","events_url":"https://api.github.com/repos/hashicorp/packer/issues/6878/events","html_url":"https://github.com/hashicorp/packer/pull/6878","id":371693525,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MDg0MzY0","number":6878,"title":"feat: ability to specify runtime OSs where shell-local should run","user":{"login":"jvasallo","id":1730603,"node_id":"MDQ6VXNlcjE3MzA2MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/1730603?v=4","gravatar_id":"","url":"https://api.github.com/users/jvasallo","html_url":"https://github.com/jvasallo","followers_url":"https://api.github.com/users/jvasallo/followers","following_url":"https://api.github.com/users/jvasallo/following{/other_user}","gists_url":"https://api.github.com/users/jvasallo/gists{/gist_id}","starred_url":"https://api.github.com/users/jvasallo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvasallo/subscriptions","organizations_url":"https://api.github.com/users/jvasallo/orgs","repos_url":"https://api.github.com/users/jvasallo/repos","events_url":"https://api.github.com/users/jvasallo/events{/privacy}","received_events_url":"https://api.github.com/users/jvasallo/received_events","type":"User","site_admin":false},"labels":[{"id":337725512,"node_id":"MDU6TGFiZWwzMzc3MjU1MTI=","url":"https://api.github.com/repos/hashicorp/packer/labels/post-processor/shell-local","name":"post-processor/shell-local","color":"fef2c0","default":false},{"id":337723416,"node_id":"MDU6TGFiZWwzMzc3MjM0MTY=","url":"https://api.github.com/repos/hashicorp/packer/labels/provisioner/shell-local","name":"provisioner/shell-local","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-18T20:13:27Z","updated_at":"2018-10-19T08:35:39Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/hashicorp/packer/pulls/6878","html_url":"https://github.com/hashicorp/packer/pull/6878","diff_url":"https://github.com/hashicorp/packer/pull/6878.diff","patch_url":"https://github.com/hashicorp/packer/pull/6878.patch"},"body":"Enabling the ability to pass in a list of runtime operating systems where shell-local should run. If list is not provided, execute default behavior. If specified, but runtime not in list, skip over execution.\r\n\r\nI was not sure to either fail earlier and raise an exception, or gracefully skip. I voted for skipping as it can potentially eliminate duplication allowing folks to do things like:\r\n```\r\n\"provisioners\": [\r\n    {\r\n      \"type\": \"shell-local\",\r\n      \"inline\": \"setup.sh\",\r\n      \"onlyon\": [\"darwin\", \"linux\"]\r\n    },\r\n    {\r\n      \"type\": \"shell-local\",\r\n      \"inline\": \"setup.bat\",\r\n      \"onlyon\": [\"windows\"]\r\n    }\r\n```\r\n\r\nApologies as I am still new to GoLang, I think there is still tons of fixes and simplifications that can be done here and open for suggestions! 👍Also, I think this can be extended if needed to other provisioners; however starting small :). \r\n\r\nPotentially closes #6678 "},"comment":{"url":"https://api.github.com/repos/hashicorp/packer/issues/comments/431288457","html_url":"https://github.com/hashicorp/packer/pull/6878#issuecomment-431288457","issue_url":"https://api.github.com/repos/hashicorp/packer/issues/6878","id":431288457,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTI4ODQ1Nw==","user":{"login":"rickard-von-essen","id":557699,"node_id":"MDQ6VXNlcjU1NzY5OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/557699?v=4","gravatar_id":"","url":"https://api.github.com/users/rickard-von-essen","html_url":"https://github.com/rickard-von-essen","followers_url":"https://api.github.com/users/rickard-von-essen/followers","following_url":"https://api.github.com/users/rickard-von-essen/following{/other_user}","gists_url":"https://api.github.com/users/rickard-von-essen/gists{/gist_id}","starred_url":"https://api.github.com/users/rickard-von-essen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickard-von-essen/subscriptions","organizations_url":"https://api.github.com/users/rickard-von-essen/orgs","repos_url":"https://api.github.com/users/rickard-von-essen/repos","events_url":"https://api.github.com/users/rickard-von-essen/events{/privacy}","received_events_url":"https://api.github.com/users/rickard-von-essen/received_events","type":"User","site_admin":false},"created_at":"2018-10-19T08:35:39Z","updated_at":"2018-10-19T08:35:39Z","author_association":"COLLABORATOR","body":"Could we add `not_on` too? Because what you really like is:\r\n\r\n```json\r\n\"provisioners\": [\r\n    {\r\n      \"type\": \"shell-local\",\r\n      \"inline\": \"setup.sh\",\r\n      \"not_on\": [\"windows\"]\r\n    },\r\n    {\r\n      \"type\": \"shell-local\",\r\n      \"inline\": \"setup.bat\",\r\n      \"only_on\": [\"windows\"]\r\n    }\r\n]\r\n```\r\n"}}
{"actor":{"display_login":"rickard-von-essen"}}