Minionutil
minionutil.change_master
#
Change to different master host.
ARGUMENTS
host
(str): Hostname of the new master to change to.
OPTIONAL ARGUMENTS
confirm
(bool): Acknowledge the execution of this command. Default isFalse
.show_changes
(bool): Show the changes made in the file/etc/salt/minion
. Default isFalse
.
note
When the master (hub) is changed, the API endpoint URL won't be updated automatically
unless there is a pending sync (for example coming from an update) that will execute the minion.config state.
note
When moving back and forth between envs and the key hasn't been accepted,
the device will keep retrying to connect to the master. If then the salt-minion service is restarted, the service won`t shutdown until a SIGKILL is sent to the process (i.e. the salt-minion service will keep retrying to connect to the salt-master)
minionutil.help
#
Shows this help information.
minionutil.last_errors
#
Get last errors from minion log.
OPTIONAL ARGUMENTS
file
(str): Default isminion
.until
(str): Default is$
.level
(str): Default iserror
.count
(int): Default is0
.before
(int): Default is0
.after
(int): Default is0
.limit
(int): Default is100
.
minionutil.last_logs
#
Get last log lines from minion log.
OPTIONAL ARGUMENTS
file
(str): Default isminion
.until
(str): Default is$
.match
(str): Default is.*
.count
(int): Default is0
.before
(int): Default is0
.after
(int): Default is0
.limit
(int): Default is100
.
minionutil.last_startup
#
Get log lines for last startup sequence.
OPTIONAL ARGUMENTS
file
(str): Default isminion
.until
(str): Default is$
.match
(str): Default isSetting up the Salt Minion
.limit
(int): Default is100
.
minionutil.log_files
#
List all minion log files.
minionutil.master_status
#
Get status of connection to master.
Implementation originates from the status.master
command but without the logic to trigger events.
minionutil.request_restart
#
Request for a future restart of the minion service.
OPTIONAL ARGUMENTS
pending
(bool): Default isTrue
.immediately
(bool): Default isFalse
.delay
(int): Default is10
.expiration
(int): Default is1200
.reason
(str): Reason code that tells why we decided to restart. Default isunknown
.
minionutil.restart
#
Restart the minion service immediately.
OPTIONAL ARGUMENTS
reason
(str): Reason code that tells why we decided to restart. Default isunknown
.
minionutil.run_job
#
Run a job by passing it to the minion process. This function makes it possible to run states and also get pillar data from external processes (engines etc.).
minionutil.status_schedule
#
Dedicated to be called from schedule and trigger minion status events.
minionutil.trigger_event
#
Triggers an event on the minion event bus.
minionutil.update_release
#
Update a minion to newest release by running a highstate if not already up-to-date.
OPTIONAL ARGUMENTS
force
(bool): Default isFalse
. Force an update, skipping all checks that would stop the update from occuring.demand
(bool): Default isFalse
. Demand an update, even if the device is already in the latest version.dry_run
(bool): Default isFalse
. Don`t actually perform the update.only_retry
(bool): Default isFalse
. Perform an update only if it is in the retrying state.reset_attempts
(bool): Default isFalse
. Set this to true if you want to reset the attempts counter that limits the amount of failed update retries.
Notes:
- The difference between the
force
anddemand
arguments is thatdemand
is used to perform an update even if the device is already up-to-date. It will not skip over the maximum allowed failed update retries.force
on the other hand will do both, it will perform an update on the device, even if its already up to date, but will also skip over the maximum allowed failed updates. In other words, they are almost the same, except that
force` will skip over the retry limit.