31 KiB
Salt 2016.11.0 Release Notes - Codename Carbon
New Features
Docker Introspection and Configuration
Major additions have been made to the Docker support in 2016.11.0. The new addition allows Salt to be executed within a Docker container without a minion running or installed in the container. This allows states to be run inside a container, but also all of Salt's remote execution commands to be run inside docker containers as well. This makes container introspection simple and powerful. See the tutorial on using this new feature here:
See Salt in Docker Containers <docker-sls>
.
Advanced Ceph Control
Our friends over at SUSE have delivered a powerful new tool to make the deployment of Ceph storage systems using Salt very easy. These new Ceph tools allow for a storage system to be easily defined using the new ceph.quorum state.
Thorium Additions and Improvements
The Thorium advanced reactor has undergone extensive testing and updates. These updates include many more Thorium states, a system for automating key management, the ability to use Thorium to easily replace old reactors and a great deal of stability and bug fixes.
State Rollback Using Snapper
Rollback has been one of the most prevalent requests for Salt. We have researched it extensively and concluded that the only way to accomplish truly reliable rollback would be to execute it at the filesystem layer. To accomplish this we have introduced Snapper integration into Salt States.
Snapper is a tool which allows for simple and reliable snapshots of the filesystem to be made. With the new snapper_states option set to True in the minion config a snapshot will be made before and after every Salt State run.
These snapshots can be viewed, managed and rolled back to via the snapper execution module.
Preserve File Perms in File States
This feature has been requested for years, the ability to set a flag and use the same file permissions for files deployed to a minion as the permissions set to the file on the master. Just set the keep_mode option on any file management state to True.
Ponies!
We all agreed that cowsay was just not good enough, install the ponysay command and the new pony outputter will work. Fun for the whole family!
Additional Features
Minions can run in stand-alone mode to use beacons and engines without having to connect to a master. (Thanks @adelcast!)
Added a
salt
runner to allow running salt modules via salt-run.salt-run salt.cmd test.ping # call functions with arguments and keyword arguments salt-run salt.cmd test.arg 1 2 3 a=1
Added SSL support to Cassandra CQL returner. SSL can be enabled by setting
ssl_options
for the returner. Also added support for specifyingprotocol_version
when establishing cluster connection.The
mode
parameter in thefile.managed <salt.states.file.managed>
state, and thefile_mode
parameter in thefile.recurse <salt.states.file.recurse>
state, can both now be set tokeep
and the minion will keep the mode of the file from the Salt fileserver. This works only with files coming from sources prefixed withsalt://
, or files local to the minion (i.e. those which are absolute paths, or are prefixed withfile://
). For example:/etc/myapp/myapp.conf: file.managed: - source: salt://conf/myapp/myapp.conf - mode: keep /var/www/myapp: file.recurse: - source: salt://path/to/myapp - dir_mode: 755 - file_mode: keep
The
junos
state module is now available. It has all the functions that are present in thejunos
execution module.The
junos
state module is now available. It has all the functions that are present in thejunos
execution module.The minion data cache is a pluggable data store now. It's configurable with
cache
option. Default islocalfs
.User names in
client_acl
support glob matching now.
New Top File Merging Strategy for States
A new strategy called merge_all
has been added to
provide a new way of merging top file matches when executing a highstate <running-highstate>
. See the top_file_merging_strategy
documentation for
further information.
In addition, the same
merging strategy was not
functioning as documented. This has now been corrected. While this is
technically a bugfix, we decided to hold a change in top file merging
until a feature release to minimize user impact.
Improved Archive Extraction Support
The archive.extracted <salt.states.archive.extracted>
state has been overhauled. Notable changes include the following:
- When enforcing ownership (with the
user
and/orgroup
arguments), theif_missing
argument no longer has any connection to which path(s) have ownership enforced. Instead, the paths are determined using the either the newly-addedarchive.list <salt.modules.archive.list_>
function, or the newly-addedenforce_ownership_on
argument. if_missing
also is no longer required to skip extraction, as Salt is now able to tell which paths would be present if the archive were extracted. It should, in most cases, only be necessary in cases where a semaphore file is used to conditionally skip extraction of the archive.- Password-protected ZIP archives are now detected before extraction, and the state fails without attempting to extract the archive if no password was specified.
- By default, a single top-level directory is enforced, to guard
against 'tar-bombs'. This enforcement can be disabled by setting
enforce_toplevel
toFalse
. - The
tar_options
andzip_options
arguments have been deprecated in favor of a singleoptions
argument. - The
archive_format
argument is now optional. The ending of thesource
argument is used to guess whether it is a tar, zip or rar file. If thearchive_format
cannot be guessed, then it will need to be specified, but in many cases it can now be omitted. - Ownership enforcement is now performed irrespective of whether or not the archive needed to be extracted. This means that the state can be re-run after the archive has been fully extracted to repair changes to ownership.
A number of new arguments were also added. See the docs pydocs for the
archive.extracted state <salt.states.archive.extracted>
for
more information.
Additionally, the following changes have been made to the archive
<salt.modules.archive>
execution module:
- A new function (
archive.list <salt.modules.archive.list_>
) has been added. This function lists the files/directories in an archive file, and supports averbose
argument that gives a more detailed breakdown of which paths are files, which are directories, and which paths are at the top level of the archive. - A new function (
archive.is_encrypted <salt.modules.archive.is_encrypted>
) has been added. This function will returnTrue
if the archive is a password-protected ZIP file,False
if not. If the archive is not a ZIP file, an error will be raised. archive.cmd_unzip <salt.modules.archive.cmd_unzip>
now supports passing a password, bringing it to feature parity witharchive.unzip <salt.modules.archive.unzip>
. Note that this is still not considered to be secure, andarchive.unzip <salt.modules.archive.unzip>
is recommended for dealing with password-protected ZIP archives.- The default value for the
extract_perms
argument toarchive.unzip <salt.modules.archive.unzip>
has been changed toTrue
.
Improved
Checksum Handling in file.managed <salt.states.file.managed>
,
archive.extracted <salt.states.archive.extracted>
States
When the source_hash
argument for these states refers to
a file containing checksums, Salt now looks for checksums matching the
name of the source URI, as well as the file being managed. Prior
releases only looked for checksums matching the filename being managed.
Additionally, a new argument (source_hash_name
) has been
added, which allows the user to disambiguate ambiguous matches when more
than one matching checksum is found in the source_hash
file.
A more detailed explanation of this functionality can be found in the
file.managed <salt.states.file.managed>
documentation, in the section for the new source_hash_name
argument.
Note
This improved functionality is also available in the
2016.3
(Boron) release cycle, starting with the 2016.3.5
release.
Config Changes
The following default config values were changed:
gitfs_ssl_verify
: Changed fromFalse
toTrue
git_pillar_ssl_verify
: Changed fromFalse
toTrue
winrepo_ssl_verify
: Changed fromFalse
toTrue
Grains Changes
All core grains containing
VMWare
have been changed toVMware
, which is the official capitalization. Additionally, all references toVMWare
in the documentation have been changed toVMware
30807
. Environments using versions of Salt before and after Salt 2016.11.0 should employ case-insensitive grain matching on these grains.{% set on_vmware = grains['virtual'].lower() == 'vmware' %}
On Windows the
cpu_model
grain has been changed to provide the actual cpu model name and not the cpu family.Old behavior:
root@master:~# salt 'testwin200' grains.item cpu_model testwin200: ---------- cpu_model: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
New behavior:
root@master:~# salt 'testwin200' grains.item cpu_model testwin200: ---------- cpu_model: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
Beacons Changes
- The
loadavg
beacon now outputs averages as integers instead of strings. (Via31124
.)
Runner Changes
- Runners can now call out to
utility modules <writing-utility-modules>
via__utils__
. - ref:`Utility modules <writing-utility-modules>` (placed in
salt://_utils/
) are now able to be synced to the master, making it easier to use them in custom runners. Asaltutil.sync_utils <salt.runners.saltutil.sync_utils>
function has been added to thesaltutil runner <salt.runners.saltutil>
to facilitate the syncing of utility modules to the master.
Pillar Changes
- Thanks to the new
saltutil.sync_utils <salt.runners.saltutil.sync_utils>
runner, it is now easier to get ref:`utility modules <writing-utility-modules>` synced to the correct location on the Master so that they are available in execution modules called from Pillar SLS files.
Junos Module Changes
- The following new functionalities were added to the junos module
- facts - Displays the facts gathered during the connection.
- shutdown - Shut down or reboot a device running Junos OS.
- install_config - Modify the configuration of a Junos device.
- install_os - Install Junos OS software package.
- zeroize - Remove all configuration information on the Routing Engines and reset all key values on a device.
- file_copy - Copy file from proxy to the Junos device.
Network Automation: NAPALM
Beginning with 2016.11.0, network automation is included by default in the core of Salt. It is based on a the NAPALM library and provides facilities to manage the configuration and retrieve data from network devices running widely used operating systems such: JunOS, IOS-XR, eOS, IOS, NX-OS etc.
The connection is established via the NAPALM proxy <salt.proxy.napalm>
.
In the current release, the following modules were included:
NAPALM grains <salt.grains.napalm>
- Select network devices based on their characteristicsNET execution module <salt.modules.napalm_network>
- Networking basic featuresNTP execution module <salt.modules.napalm_ntp>
BGP execution module <salt.modules.napalm_bgp>
Routes execution module <salt.modules.napalm_route>
SNMP execution module <salt.modules.napalm_snmp>
Users execution module <salt.modules.napalm_users>
Probes execution module <salt.modules.napalm_probes>
NTP peers management state <salt.states.netntp>
SNMP configuration management state <salt.states.netsnmp>
Users management state <salt.states.netusers>
Cisco NXOS Proxy Minion
Beginning with 2016.11.0, there is a proxy minion that can be used to configure nxos cisco devices over ssh.
Proxy Minion <salt.proxy.nxos>
Execution Module <salt.modules.nxos>
State Module <salt.states.nxos>
Cisco Network Services Orchestrator Proxy Minion
Beginning with 2016.11.0, there is a proxy minion to use the Cisco Network Services Orchestrator as a proxy minion.
Proxy Minion <salt.proxy.cisconso>
Execution Module <salt.modules.cisconso>
State Module <salt.states.cisconso>
Junos Module Changes
- The following new functionalities were added to the junos module
- facts - Displays the facts gathered during the connection.
- shutdown - Shut down or reboot a device running Junos OS.
- install_config - Modify the configuration of a Junos device.
- install_os - Install Junos OS software package.
- zeroize - Remove all configuration information on the Routing Engines and reset all key values on a device.
- file_copy - Copy file from proxy to the Junos device.
Returner Changes
- Any returner which implements a save_load function is now required to accept a minions keyword argument. All returners which ship with Salt have been modified to do so.
Renderer Changes
Added the ability to restrict allowed renderers. Two new config
parameters, renderer_whitelist
and renderer_blacklist
are introduced for this purpose.
eAuth Changes
External auth modules'
auth
method can return an ACL list for the given username instead ofTrue
. This list should be in the same format as described in theeAuth documentation <acl-eauth>
. It will be used for the user instead of one set in master config.Example of the
auth
method return that allows a user to execute functions in thetest
andnetwork
modules on the minions that match theweb*
target and allow access towheel
andrunner
modules:"web*": ["test.*", "network.*"]}, "@wheel", "@runner"] [{
External auth is supported by
salt-run <salt-run>
andsalt-key <salt-key>
now. Note that master must be started to use them with eAuth.
External Module Packaging
Modules may now be packaged via entry-points in setuptools. See external module packaging <tutorial-packaging-modules>
tutorial for more information.
Functionality Changes
The
onfail
requisite now uses OR logic instead of AND logic.22370
The consul external pillar now strips leading and trailing whitespace.
31165
The win_system.py state is now case sensitive for computer names. Previously computer names set with a state were converted to all caps. If you have a state setting computer names with lower case letters in the name that has been applied, the computer name will be changed again to apply the case sensitive name.
The
mac_user.list_groups
function in themac_user
execution module now lists all groups for the specified user, including groups beginning with an underscore. In previous releases, groups beginning with an underscore were excluded from the list of groups.The
junos.call_rpc
function in thejunos
execution module can now be used to call any valid rpc. Earlier it used to call only "get_software_information".A new option for minions called
master_tries
has been added. This specifies the number of times a minion should attempt to contact a master to attempt a connection. This allows better handling of occasional master downtime in a multi-master topology.The default hash_type is now sha256 instead of md5. You will need to make sure both your master and minion share the same hash_type.
Nodegroups consisting of a simple list of minion IDs can now also be declared as a yaml list. The below two examples are equivalent:
# Traditional way nodegroups: - group1: L@host1,host2,host3 # New way (optional) nodegroups: - group1: - host1 - host2 - host3
New Azure ARM Cloud Driver
A new cloud driver has been added for Azure ARM, aka, the Azure Resource Manager. The older Azure driver is still required to work with the older Azure API. This new driver works with the newer ARM API, which is managed via the newer Azure Portal website.
New Modules
Beacons
salt.beacons.avahi_announce <salt.beacons.avahi_announce>
salt.beacons.bonjour_announce <salt.beacons.bonjour_announce>
salt.beacons.haproxy <salt.beacons.haproxy>
salt.beacons.status <salt.beacons.status>
Clouds
salt.cloud.clouds.azurearm <salt.cloud.clouds.azurearm>
Engines
salt.engines.hipchat <salt.engines.hipchat>
salt.engines.http_logstash <salt.engines.http_logstash>
Modules
salt.modules.boto_cloudwatch_event <salt.modules.boto_cloudwatch_event>
salt.modules.celery <salt.modules.celery>
salt.modules.ceph <salt.modules.ceph>
salt.modules.influx08 <salt.modules.influx08>
salt.modules.inspectlib.entities <salt.modules.inspectlib.entities>
salt.modules.inspectlib.fsdb <salt.modules.inspectlib.fsdb>
salt.modules.inspectlib.kiwiproc <salt.modules.inspectlib.kiwiproc>
salt.modules.inspector <salt.modules.inspector>
salt.modules.libcloud_dns <salt.modules.libcloud_dns>
salt.modules.openstack_mng <salt.modules.openstack_mng>
salt.modules.servicenow <salt.modules.servicenow>
salt.modules.testinframod <salt.modules.testinframod>
salt.modules.win_lgpo <salt.modules.win_lgpo>
salt.modules.win_pki <salt.modules.win_pki>
salt.modules.win_psget <salt.modules.win_psget>
salt.modules.win_snmp <salt.modules.win_snmp>
salt.modules.xbpspkg <salt.modules.xbpspkg>
Outputters
salt.output.pony <salt.output.pony>
Pillar
salt.pillar.csvpillar <salt.pillar.csvpillar>
salt.pillar.http_json <salt.pillar.http_json>
salt.pillar.makostack <salt.pillar.makostack>
Returners
salt.returners.zabbix_return <salt.returners.zabbix_return>
Runners
salt.runners.auth <salt.runners.auth>
salt.runners.event <salt.runners.event>
salt.runners.smartos_vmadm <salt.runners.smartos_vmadm>
salt.runners.vistara <salt.runners.vistara>
SDB
salt.sdb.env <salt.sdb.env>
States
salt.states.boto_cloudwatch_event <salt.states.boto_cloudwatch_event>
salt.states.csf <salt.states.csf>
salt.states.ethtool <salt.states.ethtool>
salt.states.influxdb08_database <salt.states.influxdb08_database>
salt.states.influxdb08_user <salt.states.influxdb08_user>
salt.states.libcloud_dns <salt.states.libcloud_dns>
salt.states.snapper <salt.states.snapper>
salt.states.testinframod <salt.states.testinframod>
salt.states.win_lgpo <salt.states.win_lgpo>
salt.states.win_pki <salt.states.win_pki>
salt.states.win_snmp <salt.states.win_snmp>
Thorium
salt.thorium.calc <salt.thorium.calc>
salt.thorium.key <salt.thorium.key>
salt.thorium.runner <salt.thorium.runner>
salt.thorium.status <salt.thorium.status>
salt.thorium.wheel <salt.thorium.wheel>
Deprecations
General Deprecations
env
tosaltenv
All occurrences of
env
and some occurrences of__env__
marked for deprecation in Salt 2016.11.0 have been removed. The new way to use the salt environment setting is with a variable calledsaltenv
:def fcn(msg="", env="base", refresh=True, saltenv="base", **kwargs): ...
has been changed to
def fcn(msg="", refresh=True, saltenv="base", **kwargs): ...
If
env
(or__env__
) is supplied as a keyword argument to a function that also accepts arbitrary keyword arguments, then a new warning informs the user thatenv
is no longer used if it is found. This new warning will be removed in Salt 2017.7.0.def fcn(msg="", refresh=True, saltenv="base", **kwargs): ...
# will result in a warning log message ="add more salt", env="prod", refresh=False) fcn(msg
If
env
(or__env__
) is supplied as a keyword argument to a function that does not accept arbitrary keyword arguments, then python will issue an error.def fcn(msg="", refresh=True, saltenv="base"): ...
# will result in a python TypeError ="add more salt", env="prod", refresh=False) fcn(msg
If
env
(or__env__
) is supplied as a positional argument to a function, then undefined behavior will occur, as the removal ofenv
and__env__
from the function's argument list changes the function's signature.def fcn(msg="", refresh=True, saltenv="base"): ...
# will result in refresh evaluating to True and saltenv likely not being a string at all "add more salt", "prod", False) fcn(
Deprecations in
minion.py
:- The
salt.minion.parse_args_and_kwargs
function has been removed. Please use thesalt.minion.load_args_and_kwargs
function instead.
- The
Cloud Deprecations
- The
vsphere
cloud driver has been removed. Please use thevmware
cloud driver instead. - The
private_ip
option in thelinode
cloud driver is deprecated and has been removed. Use theassign_private_ip
option instead. - The
create_dns_record
anddelete_dns_record
functions are deprecated and have been removed from thedigital_ocean
driver. Use thepost_dns_record
function instead.
Execution Module Deprecations
The
blockdev
execution module had four functions removed:- dump
- tune
- resize2fs
- wipe
The
disk
module should be used instead with the same function names.The
boto_vpc
execution module had two functions removed,boto_vpc.associate_new_dhcp_options_to_vpc
andboto_vpc.associate_new_network_acl_to_subnet
in favor of more concise function names,boto_vpc.create_dhcp_options
andboto_vpc.create_network_acl
, respectively.The
data
execution module hadgetval
andgetvals
functions removed in favor of one function,get
, which combines the functionality of the removed functions.File module deprecations:
- The
contains_regex_multiline
function was removed. Usefile.search
instead. - Additional command line options for
file.grep
should be passed one at a time. Please do not pass more than one in a single argument.
- The
The
lxc
execution module has the following changes:- The
run_cmd
function was removed. Uselxc.run
instead. - The
nic
argument was removed from thelxc.init
function. Usenetwork_profile
instead. - The
clone
argument was removed from thelxc.init
function. Useclone_from
instead. - passwords passed to the
lxc.init
function will be assumed to be hashed, unlesspassword_encrypted=False
. - The
restart
argument forlxc.start
was removed. Uselxc.restart
instead. - The old style of defining lxc containers has been removed. Please
use keys under which LXC profiles should be configured such as
lxc.container_profile.profile_name
.
- The
The
env
andactivate
keyword arguments have been removed from theinstall
function in thepip
execution module. The use ofbin_env
replaces both of these options.reg
execution moduleFunctions in the
reg
execution module had misleading and confusing names for dealing with the Windows registry. They failed to clearly differentiate between hives, keys, and name/value pairs. Keys were treated like value names. There was no way to delete a key.New functions were added in 2015.5 to properly work with the registry. They also made it possible to edit key default values as well as delete an entire key tree recursively. With the new functions in place, the following functions have been deprecated:
- read_key
- set_key
- create_key
- delete_key
Use the following functions instead:
- for
read_key
useread_value
- for
set_key
useset_value
- for
create_key
useset_value
with novname
and novdata
- for
delete_key
usedelete_key_recursive
. To delete a value, usedelete_value
.
The
hash_hostname
option was removed from thesalt.modules.ssh
execution module. Thehash_known_hosts
option should be used instead.The
human_readable
option was removed from theuptime
function in thestatus
execution module. The function was also updated in 2015.8.9 to return a more complete offering of uptime information, formatted as an easy-to-read dictionary. This updated function replaces the need for thehuman_readable
option.The
persist
kwarg was removed from thewin_useradd
execution module. This option is no longer supported for Windows.persist
is only supported as part of user management in UNIX/Linux.The
zpool_list
function in thezpool
execution module was removed. Uselist
instead.
Outputter Module Deprecations
- The
compact
outputter has been removed. Setstate_verbose
toFalse
instead.
Runner Module Deprecations
- The
grains.cache
runner no longer acceptsoutputter
orminion
as keyword arguments. Users will need to specify an outputter using the--out
option.tgt
is replacing theminion
kwarg. - The
fileserver
runner no longer accepts theoutputter
keyword argument. Users will need to specify an outputter using the--out
option. - The
jobs
runner no longer accepts theoutputter
keyword argument. Users will need to specify an outputter using the--out
option. virt
runner module:- The
hyper
kwarg was removed from theinit
,list
, andquery
functions. Use thehost
option instead. - The
next_hyper
function was removed. Use thenext_host
function instead. - The
hyper_info
function was removed. Use thehost_info
function instead.
- The
State Module Deprecations
The
env
andactivate
keyword arguments were removed from theinstalled
function in thepip
state module. The use ofbin_env
replaces both of these options.reg
state moduleThe
reg
state module was modified to work with the new functions in the execution module. Some logic was left in thereg.present
and thereg.absent
functions to handle existing state files that used the final key in the name as the value name. That logic has been removed so you now must specify value name (vname
) and, if needed, value data (vdata
).For example, a state file that adds the version value/data pair to the Software\Salt key in the HKEY_LOCAL_MACHINE hive used to look like this:
HKEY_LOCAL_MACHINE\\Software\\Salt\\version: reg.present: - value: 2016.3.1
Now it should look like this:
HKEY_LOCAL_MACHINE\\Software\\Salt reg.present: - vname: version - vdata: 2016.3.1
A state file for removing the same value added above would have looked like this:
HKEY_LOCAL_MACHINE\\Software\\Salt\\version: reg.absent:
Now it should look like this:
HKEY_LOCAL_MACHINE\\Software\\Salt reg.absent: - vname: version
This new structure is important as it allows salt to deal with key default values which was not possible before. If vname is not passed, salt will work with the default value for that hivekey.
Additionally, since you could only delete a value from a the state module, a new function (
key_absent
) has been added to allow you to delete a registry key and all subkeys and name/value pairs recursively. It uses the newdelete_key_recursive
function.For additional information see the documentation for the
reg
execution and state modules.lxc
state module: The following functions were removed from thelxc
state module:created
: replaced by thepresent
state.started
: replaced by therunning
state.cloned
: replaced by thepresent
state. Use theclone_from
argument to set the name of the clone source.
The
hash_hostname
option was removed from thesalt.states.ssh_known_hosts
state. Thehash_known_hosts
option should be used instead.The
always
kwarg used in thebuilt
function of thepkgbuild
state module was removed. Useforce
instead.
Utils Module Deprecations
- The use of
jid_dir
andjid_load
were removed from thesalt.utils.jid
.jid_dir
functionality for job_cache management was moved to thelocal_cache
returner.jid_load
data is now retrieved from themaster_job_cache
. ip_in_subnet
function insalt.utils.network.py
has been removed. Use thein_subnet
function instead.- The
iam
utils module had two functions removed:salt.utils.iam.get_iam_region
andsalt.utils.iam.get_iam_metadata
in favor of the aws utils functionssalt.utils.aws.get_region_from_metadata
andsalt.utils.aws.creds
, respectively.