{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack-formulas/salt-formula/issues/136","labels_url":"https://api.github.com/repos/saltstack-formulas/salt-formula/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/saltstack-formulas/salt-formula/issues/136/comments","events_url":"https://api.github.com/repos/saltstack-formulas/salt-formula/issues/136/events","html_url":"https://github.com/saltstack-formulas/salt-formula/issues/136","id":78180739,"number":136,"title":"Restart salt-minion *after* end of run","user":{"login":"tlemarchand","id":11063413,"avatar_url":"https://avatars.githubusercontent.com/u/11063413?v=3","gravatar_id":"","url":"https://api.github.com/users/tlemarchand","html_url":"https://github.com/tlemarchand","followers_url":"https://api.github.com/users/tlemarchand/followers","following_url":"https://api.github.com/users/tlemarchand/following{/other_user}","gists_url":"https://api.github.com/users/tlemarchand/gists{/gist_id}","starred_url":"https://api.github.com/users/tlemarchand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlemarchand/subscriptions","organizations_url":"https://api.github.com/users/tlemarchand/orgs","repos_url":"https://api.github.com/users/tlemarchand/repos","events_url":"https://api.github.com/users/tlemarchand/events{/privacy}","received_events_url":"https://api.github.com/users/tlemarchand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-19T17:31:31Z","updated_at":"2015-06-05T22:14:39Z","closed_at":null,"body":"Hi all,\r\n\r\nIs there a reason why something like : http://docs.saltstack.com/en/latest/faq.html#what-is-the-best-way-to-restart-a-salt-daemon-using-salt is not used in this formula ?\r\n\r\nI changed salt-formula (locally), it's a huge win : I can now spawn a new salt minion (with salt-cloud) in one highstate run, without interruption.\r\n\r\nsalt/minion.sls :\r\n\r\n      cmd.wait:\r\n        - name: echo salt-call --local service.restart salt-minion | at now + 1 minute\r\n        - python_shell: True\r\n        - order: last\r\n        - watch:\r\n    {% if salt_settings.install_packages %}\r\n          - pkg: salt-minion\r\n    {% endif %}\r\n          - file: salt-minion\r\n          - file: remove-old-minion-conf-file\r\n\r\nI didn't manage \"atd\" since it's on by default on Debian, but it's definitely doable."},"comment":{"url":"https://api.github.com/repos/saltstack-formulas/salt-formula/issues/comments/109457765","html_url":"https://github.com/saltstack-formulas/salt-formula/issues/136#issuecomment-109457765","issue_url":"https://api.github.com/repos/saltstack-formulas/salt-formula/issues/136","id":109457765,"user":{"login":"puneetk","id":528061,"avatar_url":"https://avatars.githubusercontent.com/u/528061?v=3","gravatar_id":"","url":"https://api.github.com/users/puneetk","html_url":"https://github.com/puneetk","followers_url":"https://api.github.com/users/puneetk/followers","following_url":"https://api.github.com/users/puneetk/following{/other_user}","gists_url":"https://api.github.com/users/puneetk/gists{/gist_id}","starred_url":"https://api.github.com/users/puneetk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puneetk/subscriptions","organizations_url":"https://api.github.com/users/puneetk/orgs","repos_url":"https://api.github.com/users/puneetk/repos","events_url":"https://api.github.com/users/puneetk/events{/privacy}","received_events_url":"https://api.github.com/users/puneetk/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T22:14:39Z","updated_at":"2015-06-05T22:14:39Z","body":"Yup listen_in works on ubuntu, debian too :) \n> On Jun 5, 2015, at 12:31 PM, Niels Abspoel <notifications@github.com> wrote:\n> \n> @puneetk <https://github.com/puneetk> I have tested the listen_in part, and strangely on my arch box, it works\n> \n> arch.example.com:\n> ----------\n>           ID: salt-minion\n>     Function: file.recurse\n>         Name: /etc/salt/minion.d\n>       Result: True\n>      Comment: Recursively updated /etc/salt/minion.d\n>      Started: 21:28:14.689541\n>     Duration: 333.038 ms\n>      Changes:   \n>               ----------\n>               /etc/salt/minion.d/f_defaults.conf:\n>                   ----------\n>                   diff:\n>                       --- \n>                       +++ \n>                       @@ -213,7 +213,7 @@\n>                        # print verbose changes\n>                        #state_verbose: True\n>                        # multi line output\n>                       -state_output: changes\n>                       +state_output: terse\n>                        # output diff\n>                        #state_output_diff: False\n> \n>   Name: /etc/salt/minion.d/_defaults.conf - Function: file.absent - Result: Clean\n> ----------\n>           ID: salt-minion\n>     Function: service.running\n>       Result: True\n>      Comment: Service restarted\n>      Started: 21:28:15.861776\n>     Duration: 348.888 ms\n>      Changes:   \n>               ----------\n>               salt-minion:\n>                   True\n> ----------\n>           ID: listener_salt-minion\n>     Function: service.mod_watch\n>         Name: salt-minion\n>       Result: True\n>      Comment: Service restarted\n>      Started: 21:28:21.153770\n>     Duration: 309.12 ms\n>      Changes:   \n>               ----------\n>               salt-minion:\n>                   True\n> \n> Summary for arch.example.com\n> -------------\n> Succeeded: 93 (changed=4)\n> Failed:     0\n> -------------\n> Total states run:     93\n> But on my debian jessie box, it doesn't...\n> \n> debian.example.com:\n>     Minion did not return. [No response]\n> This is the change in salt/minion.sls:\n> \n> salt-minion:\n> {% if salt_settings.install_packages %}\n>   pkg.installed:\n>     - name: {{ salt_settings.salt_minion }}\n> {% endif %}\n>   file.recurse:\n>     - name: {{ salt_settings.config_path }}/minion.d\n>     - template: jinja\n>     - source: salt://salt/files/minion.d\n>     - clean: {{ salt_settings.clean_config_d_dir }}\n>     - exclude_pat: _*\n>     - context:\n>         standalone: False\n>     - listen_in:\n>       - service: salt-minion\n>   service.running:\n>     - enable: True\n>     - name: {{ salt_settings.minion_service }}\n>     - watch:\n> {% if salt_settings.install_packages %}\n>       - pkg: salt-minion\n> {% endif %}\n>       - file: salt-minion\n>       - file: remove-old-minion-conf-file\n> —\n> Reply to this email directly or view it on GitHub <https://github.com/saltstack-formulas/salt-formula/issues/136#issuecomment-109414148>.\n> \n\n"}}