{"action":"closed","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/28351","labels_url":"https://api.github.com/repos/saltstack/salt/issues/28351/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/28351/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/28351/events","html_url":"https://github.com/saltstack/salt/issues/28351","id":113806685,"number":28351,"title":"Skip Set of States when a cmd exits non-zero","user":{"login":"srkunze","id":1389648,"avatar_url":"https://avatars.githubusercontent.com/u/1389648?v=3","gravatar_id":"","url":"https://api.github.com/users/srkunze","html_url":"https://github.com/srkunze","followers_url":"https://api.github.com/users/srkunze/followers","following_url":"https://api.github.com/users/srkunze/following{/other_user}","gists_url":"https://api.github.com/users/srkunze/gists{/gist_id}","starred_url":"https://api.github.com/users/srkunze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srkunze/subscriptions","organizations_url":"https://api.github.com/users/srkunze/orgs","repos_url":"https://api.github.com/users/srkunze/repos","events_url":"https://api.github.com/users/srkunze/events{/privacy}","received_events_url":"https://api.github.com/users/srkunze/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Fixed%20Pending%20Verification","name":"Fixed Pending Verification","color":"d4c5f9"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Pending%20Discussion","name":"Pending Discussion","color":"c7def8"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Question","name":"Question","color":"942192"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","html_url":"https://github.com/saltstack/salt/milestones/Blocked","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"avatar_url":"https://avatars.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":330,"closed_issues":674,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2015-11-10T17:58:31Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2015-10-28T12:08:30Z","updated_at":"2015-11-10T17:58:31Z","closed_at":"2015-11-10T17:58:31Z","body":"Imagine I have n states and I would like to skip them altogether. The `unless` clause might be a solution. The issue with `unless` is that I need to repeat the cmd n times.\r\n\r\nThat has several drawbacks:\r\n  - code cleanliness and maintainability\r\n  - execution time (in our case cmd takes several seconds to complete)\r\n\r\nYou might ask, why not using a `{% if %}` to prevent the execution of the states in the first place? Because, before the execution of the cmd, several other states need to be applied in order for the cmd to work properly.\r\n\r\n\r\nIs there an existing solution I am missing?"}}