The static grains, these are the core, or built in grains.
When grains are loaded they are not loaded in the same way that modules are loaded, grain functions are detected and executed, the functions MUST return a dict which will be applied to the main grains dict. This module will always be executed first, so that any grains loaded here in the core module can be overwritten just by returning dict keys with the same value as those returned here
Return append_domain if set
Current working directory
Populates grains which describe whether a server has a default gateway configured or not. Uses ip -4 route show and ip -6 route show and greps for a default at the beginning of any line. Assuming the standard default via <ip> format for default gateways, it will also parse out the ip address of the default gateway, and put it in ip4_gw or ip6_gw.
If the ip command is unavailable, no grains will be populated.
Currently does not support multiple default gateways. The grains will be set to the first default gateway found.
List of grains:
ip4_gw: True # ip/True/False if default ipv4 gateway ip6_gw: True # ip/True/False if default ipv6 gateway ip_gw: True # True if either of the above is True, False otherwise
Parse the resolver configuration file
New in version 2016.3.0.
Return all known FQDNs for the system by enumerating all interfaces and then trying to reverse resolve them (excluding 'lo' interface).
Provide the machine-id for machine/virtualization combination
Provides the minion with the name of its master. This is useful in states to target other services running on the master.
Provides an integer based on the FQDN of a machine. Useful as server-id in MySQL replication or anywhere else you'll need an ID like this.
Return fqdn, hostname, domainname
On Windows the
domain grain may refer to the dns entry for the host
instead of the Windows domain to which the host is joined. It may also
be empty if not a part of any domain. Refer to the
Provide a dict of the connected interfaces and their hw addresses (Mac Address)
Return the id
Provide a dict of the connected interfaces and their ip4 addresses The addresses will be passed as a list for each interface
Provide a dict of the connected interfaces and their ip6 addresses The addresses will be passed as a list for each interface
Return ip address and FQDN grains
Provide a dict of the connected interfaces and their ip addresses The addresses will be passed as a list for each interface
Return the kernel boot parameters
Return grains pertaining to the operating system
Return the path
Return the python executable in use
Return the Python path
Return the Python version
Return the path of the salt module
Return the version of salt
Return the version_info of salt
New in version 0.17.0.
Return the zeromq version