salt.modules.freebsdports

Install software from the FreeBSD ports(7) system

2014.1.0 新版功能.

This module allows you to install ports using BATCH=yes to bypass configuration prompts. It is recommended to use the ports state to install ports, but it it also possible to use this module exclusively from the command line.

salt minion-id ports.config security/nmap IPV6=off
salt minion-id ports.install security/nmap
salt.modules.freebsdports.config(name, reset=False, **kwargs)

Modify configuration options for a given port. Multiple options can be specified. To see the available options for a port, use ports.showconfig.

name
The port name, in category/name format
reset : False
If True, runs a make rmconfig for the port, clearing its configuration before setting the desired options

CLI范例:

salt '*' ports.config security/nmap IPV6=off
salt.modules.freebsdports.deinstall(name)

De-install a port.

CLI 范例:

salt '*' ports.deinstall security/nmap
salt.modules.freebsdports.install(name, clean=True)

Install a port from the ports tree. Installs using BATCH=yes for non-interactive building. To set config options for a given port, use ports.config.

clean : True
If True, cleans after installation. Equivalent to running make install clean BATCH=yes.

注解

It may be helpful to run this function using the -t option to set a higher timeout, since compiling a port may cause the Salt command to exceed the default timeout.

CLI 范例:

salt -t 1200 '*' ports.install security/nmap
salt.modules.freebsdports.list_all()

Lists all ports available.

CLI 范例:

salt '*' ports.list_all

警告

Takes a while to run, and returns a LOT of output

salt.modules.freebsdports.rmconfig(name)

Clear the cached options for the specified port; run a make rmconfig

name
The name of the port to clear

CLI 范例:

salt '*' ports.rmconfig security/nmap
salt.modules.freebsdports.search(name)

Search for matches in the ports tree. Globs are supported, and the category is optional

CLI范例:

salt '*' ports.search 'security/*'
salt '*' ports.search 'security/n*'
salt '*' ports.search nmap

警告

Takes a while to run

salt.modules.freebsdports.showconfig(name, default=False, dict_return=False)

Show the configuration options for a given port.

default : False
Show the default options for a port (not necessarily the same as the current configuration)
dict_return : False
Instead of returning the output of make showconfig, return the data in an dictionary

CLI 范例:

salt '*' ports.showconfig security/nmap
salt '*' ports.showconfig security/nmap default=True
salt.modules.freebsdports.update(extract=False)

Update the ports tree

extract : False
If True, runs a portsnap extract after fetching, should be used for first-time installation of the ports tree.

CLI 范例:

salt '*' ports.update