Skip to content

Commit

Permalink
Merge branch '2017.7' into '2018.3'
Browse files Browse the repository at this point in the history
Conflicts:
  - doc/man/salt-api.1
  - doc/man/salt-call.1
  - doc/man/salt-cloud.1
  - doc/man/salt-cp.1
  - doc/man/salt-key.1
  - doc/man/salt-master.1
  - doc/man/salt-minion.1
  - doc/man/salt-proxy.1
  - doc/man/salt-run.1
  - doc/man/salt-ssh.1
  - doc/man/salt-syndic.1
  - doc/man/salt-unity.1
  - doc/man/salt.1
  - doc/man/salt.7
  - doc/man/spm.1
  - salt/modules/cmdmod.py
  - salt/modules/pillar.py
  - salt/modules/yumpkg.py
  - salt/state.py
  - salt/utils/pkg/rpm.py
  - salt/utils/schedule.py
  - tests/integration/states/test_npm.py
  - tests/integration/states/test_pkgrepo.py
  • Loading branch information
rallytime committed Mar 27, 2018
2 parents c83d9e6 + b548a3e commit e312efb
Show file tree
Hide file tree
Showing 43 changed files with 4,252 additions and 560 deletions.
3 changes: 1 addition & 2 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ provisioner:
salt_version: latest
salt_bootstrap_url: https://bootstrap.saltstack.com
salt_bootstrap_options: -X -p rsync stable <%= version %>
log_level: info
log_level: debug
sudo: true
require_chef: false
retry_on_exit_code:
Expand Down Expand Up @@ -189,7 +189,6 @@ suites:
verifier:
name: runtests
sudo: true
verbose: true
run_destructive: true
transport: zeromq
types:
Expand Down
35 changes: 23 additions & 12 deletions doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,19 @@ specifying the pillar variable is the same one used for :py:func:`pillar.get
<salt.states.file.managed>` state is only supported in Salt 2015.8.4 and
newer.

.. _faq-restart-salt-minion:

What is the best way to restart a Salt Minion daemon using Salt after upgrade?
------------------------------------------------------------------------------

Updating the ``salt-minion`` package requires a restart of the ``salt-minion``
service. But restarting the service while in the middle of a state run
interrupts the process of the Minion running states and sending results back to
the Master. A common way to workaround that is to schedule restarting of the
Minion service using :ref:`masterless mode <masterless-quickstart>` after all
other states have been applied. This allows the minion to keep Minion to Master
connection alive for the Minion to report the final results to the Master, while
the service is restarting in the background.
the Master. A common way to workaround that is to schedule restarting the
Minion service in the background by issuing a ``salt-call`` command calling
``service.restart`` function. This prevents the Minion being disconnected from
the Master immediately. Otherwise you would get
``Minion did not return. [Not connected]`` message as the result of a state run.

Upgrade without automatic restart
*********************************
Expand Down Expand Up @@ -328,7 +330,7 @@ The following example works on UNIX-like operating systems:
{%- if grains['os'] != 'Windows' %}
Restart Salt Minion:
cmd.run:
- name: 'salt-call --local service.restart salt-minion'
- name: 'salt-call service.restart salt-minion'
- bg: True
- onchanges:
- pkg: Upgrade Salt Minion
Expand All @@ -348,17 +350,23 @@ as follows:
Restart Salt Minion:
cmd.run:
{%- if grains['kernel'] == 'Windows' %}
- name: 'C:\salt\salt-call.bat --local service.restart salt-minion'
- name: 'C:\salt\salt-call.bat service.restart salt-minion'
{%- else %}
- name: 'salt-call --local service.restart salt-minion'
- name: 'salt-call service.restart salt-minion'
{%- endif %}
- bg: True
- onchanges:
- pkg: Upgrade Salt Minion
However, it requires more advanced tricks to upgrade from legacy version of
Salt (before ``2016.3.0``) on UNIX-like operating systems, where executing
commands in the background is not supported:
commands in the background is not supported. You also may need to schedule
restarting the Minion service using :ref:`masterless mode
<masterless-quickstart>` after all other states have been applied for Salt
versions earlier than ``2016.11.0``. This allows the Minion to keep the
connection to the Master alive for being able to report the final results back
to the Master, while the service is restarting in the background. This state
should run last or watch for the ``pkg`` state changes:

.. code-block:: jinja
Expand All @@ -382,8 +390,8 @@ Restart the Minion from the command line:

.. code-block:: bash
salt -G kernel:Windows cmd.run_bg 'C:\salt\salt-call.bat --local service.restart salt-minion'
salt -C 'not G@kernel:Windows' cmd.run_bg 'salt-call --local service.restart salt-minion'
salt -G kernel:Windows cmd.run_bg 'C:\salt\salt-call.bat service.restart salt-minion'
salt -C 'not G@kernel:Windows' cmd.run_bg 'salt-call service.restart salt-minion'
Salting the Salt Master
-----------------------
Expand All @@ -409,6 +417,10 @@ for salt itself:

https://github.com/saltstack-formulas/salt-formula

Restarting the ``salt-master`` service using execution module or application of
state could be done the same way as for the Salt minion described :ref:`above
<faq-restart-salt-minion>`.

.. _faq-grain-security:

Is Targeting using Grain Data Secure?
Expand Down Expand Up @@ -443,4 +455,3 @@ the grain and values that you want to change / set.)

You should also `file an issue <https://github.com/saltstack/salt/issues>`_
describing the change so it can be fixed in Salt.

Loading

0 comments on commit e312efb

Please sign in to comment.