Documentation
¶
Index ¶
- func GetSpec() (*types.Spec, error)
- func ModuleByName(ty string) types.Module
- type Apt
- type AptKey
- type AptKeyParams
- type AptKeyResult
- type AptParams
- type AptRepository
- type AptRepositoryParams
- type AptRepositoryResult
- type AptResult
- type Assemble
- type AssembleParams
- type AssembleResult
- type AsyncStatus
- type AsyncStatusParams
- type AsyncStatusResult
- type Blockinfile
- type BlockinfileParams
- type BlockinfileResult
- type Command
- type CommandParams
- type CommandResult
- type Cron
- type CronParams
- type CronResult
- type Debconf
- type DebconfParams
- type DebconfResult
- type Dnf
- type DnfParams
- type DnfResult
- type DpkgSelections
- type DpkgSelectionsParams
- type DpkgSelectionsResult
- type Expect
- type ExpectParams
- type ExpectResult
- type File
- type FileParams
- type FileResult
- type Find
- type FindParams
- type FindResult
- type GetUrl
- type GetUrlParams
- type GetUrlResult
- type Getent
- type GetentParams
- type GetentResult
- type Git
- type GitParams
- type GitResult
- type Group
- type GroupParams
- type GroupResult
- type Hostname
- type HostnameParams
- type HostnameResult
- type Iptables
- type IptablesParams
- type IptablesResult
- type KnownHosts
- type KnownHostsParams
- type KnownHostsResult
- type Lineinfile
- type LineinfileParams
- type LineinfileResult
- type Pip
- type PipParams
- type PipResult
- type Reboot
- type RebootParams
- type RebootResult
- type Replace
- type ReplaceParams
- type ReplaceResult
- type RpmKey
- type RpmKeyParams
- type RpmKeyResult
- type Setup
- type SetupParams
- type SetupResult
- type Slurp
- type SlurpParams
- type SlurpResult
- type Stat
- type StatParams
- type StatResult
- type Subversion
- type SubversionParams
- type SubversionResult
- type Systemd
- type SystemdParams
- type SystemdResult
- type Sysvinit
- type SysvinitParams
- type SysvinitResult
- type Tempfile
- type TempfileParams
- type TempfileResult
- type Template
- type TemplateParams
- type TemplateResult
- type Unarchive
- type UnarchiveParams
- type UnarchiveResult
- type Uri
- type UriParams
- type UriResult
- type User
- type UserParams
- type UserResult
- type WaitFor
- type WaitForParams
- type WaitForResult
- type Yum
- type YumParams
- type YumRepository
- type YumRepositoryParams
- type YumRepositoryResult
- type YumResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModuleByName ¶
Types ¶
type Apt ¶
Apt (apt) - Manages apt-packages
Manages I(apt) packages (such as for Debian/Ubuntu).
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/apt.py
func (*Apt) GetCommonResult ¶ added in v0.0.3
func (m *Apt) GetCommonResult() types.CommonReturn
func (*Apt) GetResultRaw ¶
type AptKey ¶
type AptKey struct {
Params AptKeyParams
Result AptKeyResult
}
AptKey (apt_key) - Add or remove an apt key
Add or remove an I(apt) key, optionally downloading it.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/apt_key.py
func (*AptKey) GetCommonResult ¶ added in v0.0.3
func (m *AptKey) GetCommonResult() types.CommonReturn
func (*AptKey) GetResultRaw ¶
type AptKeyParams ¶
type AptKeyParams struct {
// Data
// The keyfile contents to add to the keyring.
//
// Default: <no value>
// Required: false
Data string `yaml:"data,omitempty" json:"data,omitempty" cty:"data"`
// File
// The path to a keyfile on the remote server to add to the keyring.
//
// Default: <no value>
// Required: false
File string `yaml:"file,omitempty" json:"file,omitempty" cty:"file"`
// Id
// The identifier of the key.
// Including this allows check mode to correctly report the changed state.
// If specifying a subkey's id be aware that apt-key does not understand how to remove keys via a subkey id. Specify the primary key's id instead.
// This parameter is required when C(state) is set to C(absent).
//
// Default: <no value>
// Required: false
Id string `yaml:"id,omitempty" json:"id,omitempty" cty:"id"`
// Keyring
// The full path to specific keyring file in C(/etc/apt/trusted.gpg.d/).
//
// Default: <no value>
// Required: false
Keyring string `yaml:"keyring,omitempty" json:"keyring,omitempty" cty:"keyring"`
// Keyserver
// The keyserver to retrieve key from.
//
// Default: <no value>
// Required: false
Keyserver string `yaml:"keyserver,omitempty" json:"keyserver,omitempty" cty:"keyserver"`
// State
// Ensures that the key is present (added) or absent (revoked).
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// Url
// The URL to retrieve key from.
//
// Default: <no value>
// Required: false
Url string `yaml:"url,omitempty" json:"url,omitempty" cty:"url"`
// ValidateCerts
// If C(no), SSL certificates for the target url will not be validated. This should only be used on personally controlled sites using self-signed certificates.
//
// Default: yes
// Required: false
ValidateCerts bool `yaml:"validate_certs,omitempty" json:"validate_certs,omitempty" cty:"validate_certs"`
// contains filtered or unexported fields
}
func (*AptKeyParams) Get ¶ added in v0.0.6
func (p *AptKeyParams) Get(name string) (interface{}, error)
func (*AptKeyParams) Names ¶ added in v0.0.6
func (p *AptKeyParams) Names() []string
func (*AptKeyParams) Set ¶ added in v0.0.6
func (p *AptKeyParams) Set(name string, value interface{}) error
type AptKeyResult ¶
type AptKeyResult struct {
types.CommonReturn
Raw string
// After
// List of apt key ids or fingerprints after any modification
After []string `yaml:"after,omitempty" json:"after,omitempty" cty:"after"`
// Before
// List of apt key ids or fingprints before any modifications
Before []string `yaml:"before,omitempty" json:"before,omitempty" cty:"before"`
// Fp
// Fingerprint of the key to import
Fp string `yaml:"fp,omitempty" json:"fp,omitempty" cty:"fp"`
// Id
// key id from source
Id string `yaml:"id,omitempty" json:"id,omitempty" cty:"id"`
// KeyId
// calculated key id, it should be same as 'id', but can be different
KeyId string `yaml:"key_id,omitempty" json:"key_id,omitempty" cty:"key_id"`
// ShortId
// caclulated short key id
ShortId string `yaml:"short_id,omitempty" json:"short_id,omitempty" cty:"short_id"`
// contains filtered or unexported fields
}
func (*AptKeyResult) Get ¶ added in v0.0.6
func (r *AptKeyResult) Get(name string) (interface{}, error)
func (*AptKeyResult) Names ¶ added in v0.0.6
func (r *AptKeyResult) Names() []string
func (*AptKeyResult) Set ¶ added in v0.0.6
func (r *AptKeyResult) Set(name string, value interface{}) error
type AptParams ¶
type AptParams struct {
// AllowChangeHeldPackages
// Allows changing the version of a package which is on the apt hold list
//
// Default: no
// Required: false
AllowChangeHeldPackages bool `yaml:"allow_change_held_packages,omitempty" json:"allow_change_held_packages,omitempty" cty:"allow_change_held_packages"`
// AllowDowngrade
// Corresponds to the C(--allow-downgrades) option for I(apt).
// This option enables the named package and version to replace an already installed higher version of that package.
// Note that setting I(allow_downgrade=true) can make this module behave in a non-idempotent way.
// (The task could end up with a set of packages that does not match the complete list of specified packages to install).
//
// Default: no
// Required: false
AllowDowngrade bool `yaml:"allow_downgrade,omitempty" json:"allow_downgrade,omitempty" cty:"allow_downgrade"`
// AllowUnauthenticated
// Ignore if packages cannot be authenticated. This is useful for bootstrapping environments that manage their own apt-key setup.
// C(allow_unauthenticated) is only supported with state: I(install)/I(present)
//
// Default: no
// Required: false
AllowUnauthenticated bool `yaml:"allow_unauthenticated,omitempty" json:"allow_unauthenticated,omitempty" cty:"allow_unauthenticated"`
// Autoclean
// If C(yes), cleans the local repository of retrieved package files that can no longer be downloaded.
//
// Default: no
// Required: false
Autoclean bool `yaml:"autoclean,omitempty" json:"autoclean,omitempty" cty:"autoclean"`
// Autoremove
// If C(yes), remove unused dependency packages for all module states except I(build-dep). It can also be used as the only option.
// Previous to version 2.4, autoclean was also an alias for autoremove, now it is its own separate command. See documentation for further information.
//
// Default: no
// Required: false
Autoremove bool `yaml:"autoremove,omitempty" json:"autoremove,omitempty" cty:"autoremove"`
// CacheValidTime
// Update the apt cache if it is older than the I(cache_valid_time). This option is set in seconds.
// As of Ansible 2.4, if explicitly set, this sets I(update_cache=yes).
//
// Default: 0
// Required: false
CacheValidTime int `yaml:"cache_valid_time,omitempty" json:"cache_valid_time,omitempty" cty:"cache_valid_time"`
// Clean
// Run the equivalent of C(apt-get clean) to clear out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
// Can be run as part of the package installation (clean runs before install) or as a separate step.
//
// Default: no
// Required: false
Clean bool `yaml:"clean,omitempty" json:"clean,omitempty" cty:"clean"`
// Deb
// Path to a .deb package on the remote machine.
// If :// in the path, ansible will attempt to download deb before installing. (Version added 2.1)
// Requires the C(xz-utils) package to extract the control file of the deb package to install.
//
// Default: <no value>
// Required: false
Deb string `yaml:"deb,omitempty" json:"deb,omitempty" cty:"deb"`
// DefaultRelease
// Corresponds to the C(-t) option for I(apt) and sets pin priorities
//
// Default: <no value>
// Required: false
DefaultRelease string `yaml:"default_release,omitempty" json:"default_release,omitempty" cty:"default_release"`
// DpkgOptions
// Add dpkg options to apt command. Defaults to '-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"'
// Options should be supplied as comma separated list
//
// Default: force-confdef,force-confold
// Required: false
DpkgOptions string `yaml:"dpkg_options,omitempty" json:"dpkg_options,omitempty" cty:"dpkg_options"`
// FailOnAutoremove
// Corresponds to the C(--no-remove) option for C(apt).
// If C(yes), it is ensured that no packages will be removed or the task will fail.
// C(fail_on_autoremove) is only supported with state except C(absent)
//
// Default: no
// Required: false
FailOnAutoremove bool `yaml:"fail_on_autoremove,omitempty" json:"fail_on_autoremove,omitempty" cty:"fail_on_autoremove"`
// Force
// Corresponds to the C(--force-yes) to I(apt-get) and implies C(allow_unauthenticated: yes) and C(allow_downgrade: yes)
// This option will disable checking both the packages' signatures and the certificates of the web servers they are downloaded from.
// This option *is not* the equivalent of passing the C(-f) flag to I(apt-get) on the command line
// **This is a destructive operation with the potential to destroy your system, and it should almost never be used.** Please also see C(man apt-get) for more information.
//
// Default: no
// Required: false
Force bool `yaml:"force,omitempty" json:"force,omitempty" cty:"force"`
// ForceAptGet
// Force usage of apt-get instead of aptitude
//
// Default: no
// Required: false
ForceAptGet bool `yaml:"force_apt_get,omitempty" json:"force_apt_get,omitempty" cty:"force_apt_get"`
// InstallRecommends
// Corresponds to the C(--no-install-recommends) option for I(apt). C(yes) installs recommended packages. C(no) does not install recommended packages. By default, Ansible will use the same defaults as the operating system. Suggested packages are never installed.
//
// Default: <no value>
// Required: false
InstallRecommends bool `yaml:"install_recommends,omitempty" json:"install_recommends,omitempty" cty:"install_recommends"`
// LockTimeout
// How many seconds will this action wait to acquire a lock on the apt db.
// Sometimes there is a transitory lock and this will retry at least until timeout is hit.
//
// Default: 60
// Required: false
LockTimeout int `yaml:"lock_timeout,omitempty" json:"lock_timeout,omitempty" cty:"lock_timeout"`
// Name
// A list of package names, like C(foo), or package specifier with version, like C(foo=1.0) or C(foo>=1.0). Name wildcards (fnmatch) like C(apt*) and version wildcards like C(foo=1.0*) are also supported.
//
// Default: <no value>
// Required: false
Name []string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// OnlyUpgrade
// Only upgrade a package if it is already installed.
//
// Default: no
// Required: false
OnlyUpgrade bool `yaml:"only_upgrade,omitempty" json:"only_upgrade,omitempty" cty:"only_upgrade"`
// PolicyRcD
// Force the exit code of /usr/sbin/policy-rc.d.
// For example, if I(policy_rc_d=101) the installed package will not trigger a service start.
// If /usr/sbin/policy-rc.d already exists, it is backed up and restored after the package installation.
// If C(null), the /usr/sbin/policy-rc.d isn't created/changed.
//
// Default: <no value>
// Required: false
PolicyRcD int `yaml:"policy_rc_d,omitempty" json:"policy_rc_d,omitempty" cty:"policy_rc_d"`
// Purge
// Will force purging of configuration files if the module state is set to I(absent).
//
// Default: no
// Required: false
Purge bool `yaml:"purge,omitempty" json:"purge,omitempty" cty:"purge"`
// State
// Indicates the desired package state. C(latest) ensures that the latest version is installed. C(build-dep) ensures the package build dependencies are installed. C(fixed) attempt to correct a system with broken dependencies in place.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// UpdateCache
// Run the equivalent of C(apt-get update) before the operation. Can be run as part of the package installation or as a separate step.
// Default is not to update the cache.
//
// Default: <no value>
// Required: false
UpdateCache bool `yaml:"update_cache,omitempty" json:"update_cache,omitempty" cty:"update_cache"`
// UpdateCacheRetries
// Amount of retries if the cache update fails. Also see I(update_cache_retry_max_delay).
//
// Default: 5
// Required: false
UpdateCacheRetries int `yaml:"update_cache_retries,omitempty" json:"update_cache_retries,omitempty" cty:"update_cache_retries"`
// UpdateCacheRetryMaxDelay
// Use an exponential backoff delay for each retry (see I(update_cache_retries)) up to this max delay in seconds.
//
// Default: 12
// Required: false
UpdateCacheRetryMaxDelay int `` /* 126-byte string literal not displayed */
// Upgrade
// If yes or safe, performs an aptitude safe-upgrade.
// If full, performs an aptitude full-upgrade.
// If dist, performs an apt-get dist-upgrade.
// Note: This does not upgrade a specific package, use state=latest for that.
// Note: Since 2.4, apt-get is used as a fall-back if aptitude is not present.
//
// Default: no
// Required: false
Upgrade string `yaml:"upgrade,omitempty" json:"upgrade,omitempty" cty:"upgrade"`
// contains filtered or unexported fields
}
type AptRepository ¶
type AptRepository struct {
Params AptRepositoryParams
Result AptRepositoryResult
}
AptRepository (apt_repository) - Add and remove APT repositories
Add or remove an APT repositories in Ubuntu and Debian.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/apt_repository.py
func NewAptRepository ¶
func NewAptRepository() *AptRepository
AptRepository (apt_repository) - Add and remove APT repositories
func (*AptRepository) GetCommonResult ¶ added in v0.0.3
func (m *AptRepository) GetCommonResult() types.CommonReturn
func (*AptRepository) GetParams ¶
func (m *AptRepository) GetParams() types.Params
func (*AptRepository) GetResult ¶
func (m *AptRepository) GetResult() types.Result
func (*AptRepository) GetResultRaw ¶
func (m *AptRepository) GetResultRaw() string
func (*AptRepository) GetType ¶
func (m *AptRepository) GetType() string
type AptRepositoryParams ¶
type AptRepositoryParams struct {
// Codename
// Override the distribution codename to use for PPA repositories. Should usually only be set when working with a PPA on a non-Ubuntu target (for example, Debian or Mint).
//
// Default: <no value>
// Required: false
Codename string `yaml:"codename,omitempty" json:"codename,omitempty" cty:"codename"`
// Filename
// Sets the name of the source list file in sources.list.d. Defaults to a file name based on the repository source url. The .list extension will be automatically added.
//
// Default: <no value>
// Required: false
Filename string `yaml:"filename,omitempty" json:"filename,omitempty" cty:"filename"`
// InstallPythonApt
// Whether to automatically try to install the Python apt library or not, if it is not already installed. Without this library, the module does not work.
// Runs C(apt-get install python-apt) for Python 2, and C(apt-get install python3-apt) for Python 3.
// Only works with the system Python 2 or Python 3. If you are using a Python on the remote that is not the system Python, set I(install_python_apt=false) and ensure that the Python apt library for your Python version is installed some other way.
//
// Default: true
// Required: false
InstallPythonApt bool `yaml:"install_python_apt,omitempty" json:"install_python_apt,omitempty" cty:"install_python_apt"`
// Mode
// The octal mode for newly created files in sources.list.d.
// Default is what system uses (probably 0644).
//
// Default: <no value>
// Required: false
Mode string `yaml:"mode,omitempty" json:"mode,omitempty" cty:"mode"`
// Repo
// A source string for the repository.
//
// Default: <no value>
// Required: true
Repo string `yaml:"repo,omitempty" json:"repo,omitempty" cty:"repo"`
// State
// A source string state.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// UpdateCache
// Run the equivalent of C(apt-get update) when a change occurs. Cache updates are run after making changes.
//
// Default: yes
// Required: false
UpdateCache bool `yaml:"update_cache,omitempty" json:"update_cache,omitempty" cty:"update_cache"`
// UpdateCacheRetries
// Amount of retries if the cache update fails. Also see I(update_cache_retry_max_delay).
//
// Default: 5
// Required: false
UpdateCacheRetries int `yaml:"update_cache_retries,omitempty" json:"update_cache_retries,omitempty" cty:"update_cache_retries"`
// UpdateCacheRetryMaxDelay
// Use an exponential backoff delay for each retry (see I(update_cache_retries)) up to this max delay in seconds.
//
// Default: 12
// Required: false
UpdateCacheRetryMaxDelay int `` /* 126-byte string literal not displayed */
// ValidateCerts
// If C(no), SSL certificates for the target repo will not be validated. This should only be used on personally controlled sites using self-signed certificates.
//
// Default: yes
// Required: false
ValidateCerts bool `yaml:"validate_certs,omitempty" json:"validate_certs,omitempty" cty:"validate_certs"`
// contains filtered or unexported fields
}
func (*AptRepositoryParams) Get ¶ added in v0.0.6
func (p *AptRepositoryParams) Get(name string) (interface{}, error)
func (*AptRepositoryParams) Names ¶ added in v0.0.6
func (p *AptRepositoryParams) Names() []string
func (*AptRepositoryParams) Set ¶ added in v0.0.6
func (p *AptRepositoryParams) Set(name string, value interface{}) error
type AptRepositoryResult ¶
type AptRepositoryResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*AptRepositoryResult) Get ¶ added in v0.0.6
func (r *AptRepositoryResult) Get(name string) (interface{}, error)
func (*AptRepositoryResult) Names ¶ added in v0.0.6
func (r *AptRepositoryResult) Names() []string
func (*AptRepositoryResult) Set ¶ added in v0.0.6
func (r *AptRepositoryResult) Set(name string, value interface{}) error
type AptResult ¶
type AptResult struct {
types.CommonReturn
Raw string
// CacheUpdateTime
// time of the last cache update (0 if unknown)
CacheUpdateTime int `yaml:"cache_update_time,omitempty" json:"cache_update_time,omitempty" cty:"cache_update_time"`
// CacheUpdated
// if the cache was updated or not
CacheUpdated bool `yaml:"cache_updated,omitempty" json:"cache_updated,omitempty" cty:"cache_updated"`
// Stderr
// error output from apt
Stderr string `yaml:"stderr,omitempty" json:"stderr,omitempty" cty:"stderr"`
// Stdout
// output from apt
Stdout string `yaml:"stdout,omitempty" json:"stdout,omitempty" cty:"stdout"`
// contains filtered or unexported fields
}
type Assemble ¶
type Assemble struct {
Params AssembleParams
Result AssembleResult
}
Assemble (assemble) - Assemble configuration files from fragments
Assembles a configuration file from fragments.
Often a particular program will take a single configuration file and does not support a C(conf.d) style structure where it is easy to build up the configuration from multiple sources. C(assemble) will take a directory of files that can be local or have already been transferred to the system, and concatenate them together to produce a destination file.
Files are assembled in string sorting order.
Puppet calls this idea I(fragments).
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/assemble.py
func NewAssemble ¶
func NewAssemble() *Assemble
Assemble (assemble) - Assemble configuration files from fragments
func (*Assemble) GetCommonResult ¶ added in v0.0.3
func (m *Assemble) GetCommonResult() types.CommonReturn
func (*Assemble) GetResultRaw ¶
type AssembleParams ¶
type AssembleParams struct {
// Backup
// Create a backup file (if C(yes)), including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
//
// Default: no
// Required: false
Backup bool `yaml:"backup,omitempty" json:"backup,omitempty" cty:"backup"`
// Delimiter
// A delimiter to separate the file contents.
//
// Default: <no value>
// Required: false
Delimiter string `yaml:"delimiter,omitempty" json:"delimiter,omitempty" cty:"delimiter"`
// Dest
// A file to create using the concatenation of all of the source files.
//
// Default: <no value>
// Required: true
Dest string `yaml:"dest,omitempty" json:"dest,omitempty" cty:"dest"`
// IgnoreHidden
// A boolean that controls if files that start with a '.' will be included or not.
//
// Default: no
// Required: false
IgnoreHidden bool `yaml:"ignore_hidden,omitempty" json:"ignore_hidden,omitempty" cty:"ignore_hidden"`
// Regexp
// Assemble files only if C(regex) matches the filename.
// If not set, all files are assembled.
// Every "\" (backslash) must be escaped as "\\" to comply to YAML syntax.
// Uses L(Python regular expressions,https://docs.python.org/3/library/re.html).
//
// Default: <no value>
// Required: false
Regexp string `yaml:"regexp,omitempty" json:"regexp,omitempty" cty:"regexp"`
// RemoteSrc
// If C(no), it will search for src at originating/master machine.
// If C(yes), it will go to the remote/target machine for the src.
//
// Default: yes
// Required: false
RemoteSrc bool `yaml:"remote_src,omitempty" json:"remote_src,omitempty" cty:"remote_src"`
// Src
// An already existing directory full of source files.
//
// Default: <no value>
// Required: true
Src string `yaml:"src,omitempty" json:"src,omitempty" cty:"src"`
// Validate
// The validation command to run before copying into place.
// The path to the file to validate is passed in via '%s' which must be present as in the sshd example below.
// The command is passed securely so shell features like expansion and pipes won't work.
//
// Default: <no value>
// Required: false
Validate string `yaml:"validate,omitempty" json:"validate,omitempty" cty:"validate"`
// contains filtered or unexported fields
}
func (*AssembleParams) Get ¶ added in v0.0.6
func (p *AssembleParams) Get(name string) (interface{}, error)
func (*AssembleParams) Names ¶ added in v0.0.6
func (p *AssembleParams) Names() []string
func (*AssembleParams) Set ¶ added in v0.0.6
func (p *AssembleParams) Set(name string, value interface{}) error
type AssembleResult ¶
type AssembleResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*AssembleResult) Get ¶ added in v0.0.6
func (r *AssembleResult) Get(name string) (interface{}, error)
func (*AssembleResult) Names ¶ added in v0.0.6
func (r *AssembleResult) Names() []string
func (*AssembleResult) Set ¶ added in v0.0.6
func (r *AssembleResult) Set(name string, value interface{}) error
type AsyncStatus ¶
type AsyncStatus struct {
Params AsyncStatusParams
Result AsyncStatusResult
}
AsyncStatus (async_status) - Obtain status of asynchronous task
This module gets the status of an asynchronous task.
This module is also supported for Windows targets.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/async_status.py
func NewAsyncStatus ¶
func NewAsyncStatus() *AsyncStatus
AsyncStatus (async_status) - Obtain status of asynchronous task
func (*AsyncStatus) GetCommonResult ¶ added in v0.0.3
func (m *AsyncStatus) GetCommonResult() types.CommonReturn
func (*AsyncStatus) GetParams ¶
func (m *AsyncStatus) GetParams() types.Params
func (*AsyncStatus) GetResult ¶
func (m *AsyncStatus) GetResult() types.Result
func (*AsyncStatus) GetResultRaw ¶
func (m *AsyncStatus) GetResultRaw() string
func (*AsyncStatus) GetType ¶
func (m *AsyncStatus) GetType() string
type AsyncStatusParams ¶
type AsyncStatusParams struct {
// Jid
// Job or task identifier
//
// Default: <no value>
// Required: true
Jid string `yaml:"jid,omitempty" json:"jid,omitempty" cty:"jid"`
// Mode
// If C(status), obtain the status.
// If C(cleanup), clean up the async job cache (by default in C(~/.ansible_async/)) for the specified job I(jid).
//
// Default: status
// Required: false
Mode string `yaml:"mode,omitempty" json:"mode,omitempty" cty:"mode"`
// contains filtered or unexported fields
}
func (*AsyncStatusParams) Get ¶ added in v0.0.6
func (p *AsyncStatusParams) Get(name string) (interface{}, error)
func (*AsyncStatusParams) Names ¶ added in v0.0.6
func (p *AsyncStatusParams) Names() []string
func (*AsyncStatusParams) Set ¶ added in v0.0.6
func (p *AsyncStatusParams) Set(name string, value interface{}) error
type AsyncStatusResult ¶
type AsyncStatusResult struct {
types.CommonReturn
Raw string
// AnsibleJobId
// The asynchronous job id
AnsibleJobId string `yaml:"ansible_job_id,omitempty" json:"ansible_job_id,omitempty" cty:"ansible_job_id"`
// Erased
// Path to erased job file
Erased string `yaml:"erased,omitempty" json:"erased,omitempty" cty:"erased"`
// Finished
// Whether the asynchronous job has finished (C(1)) or not (C(0))
Finished int `yaml:"finished,omitempty" json:"finished,omitempty" cty:"finished"`
// Started
// Whether the asynchronous job has started (C(1)) or not (C(0))
Started int `yaml:"started,omitempty" json:"started,omitempty" cty:"started"`
// Stderr
// Any errors returned by async_wrapper
Stderr string `yaml:"stderr,omitempty" json:"stderr,omitempty" cty:"stderr"`
// Stdout
// Any output returned by async_wrapper
Stdout string `yaml:"stdout,omitempty" json:"stdout,omitempty" cty:"stdout"`
// contains filtered or unexported fields
}
func (*AsyncStatusResult) Get ¶ added in v0.0.6
func (r *AsyncStatusResult) Get(name string) (interface{}, error)
func (*AsyncStatusResult) Names ¶ added in v0.0.6
func (r *AsyncStatusResult) Names() []string
func (*AsyncStatusResult) Set ¶ added in v0.0.6
func (r *AsyncStatusResult) Set(name string, value interface{}) error
type Blockinfile ¶
type Blockinfile struct {
Params BlockinfileParams
Result BlockinfileResult
}
Blockinfile (blockinfile) - Insert/update/remove a text block surrounded by marker lines
This module will insert/update/remove a block of multi-line text surrounded by customizable marker lines.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/blockinfile.py
func NewBlockinfile ¶
func NewBlockinfile() *Blockinfile
Blockinfile (blockinfile) - Insert/update/remove a text block surrounded by marker lines
func (*Blockinfile) GetCommonResult ¶ added in v0.0.3
func (m *Blockinfile) GetCommonResult() types.CommonReturn
func (*Blockinfile) GetParams ¶
func (m *Blockinfile) GetParams() types.Params
func (*Blockinfile) GetResult ¶
func (m *Blockinfile) GetResult() types.Result
func (*Blockinfile) GetResultRaw ¶
func (m *Blockinfile) GetResultRaw() string
func (*Blockinfile) GetType ¶
func (m *Blockinfile) GetType() string
type BlockinfileParams ¶
type BlockinfileParams struct {
// Backup
// Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
//
// Default: no
// Required: false
Backup bool `yaml:"backup,omitempty" json:"backup,omitempty" cty:"backup"`
// Block
// The text to insert inside the marker lines.
// If it is missing or an empty string, the block will be removed as if C(state) were specified to C(absent).
//
// Default:
// Required: false
Block string `yaml:"block,omitempty" json:"block,omitempty" cty:"block"`
// Create
// Create a new file if it does not exist.
//
// Default: no
// Required: false
Create bool `yaml:"create,omitempty" json:"create,omitempty" cty:"create"`
// Insertafter
// If specified and no begin/ending C(marker) lines are found, the block will be inserted after the last match of specified regular expression.
// A special value is available; C(EOF) for inserting the block at the end of the file.
// If specified regular expression has no matches, C(EOF) will be used instead.
//
// Default: EOF
// Required: false
Insertafter string `yaml:"insertafter,omitempty" json:"insertafter,omitempty" cty:"insertafter"`
// Insertbefore
// If specified and no begin/ending C(marker) lines are found, the block will be inserted before the last match of specified regular expression.
// A special value is available; C(BOF) for inserting the block at the beginning of the file.
// If specified regular expression has no matches, the block will be inserted at the end of the file.
//
// Default: <no value>
// Required: false
Insertbefore string `yaml:"insertbefore,omitempty" json:"insertbefore,omitempty" cty:"insertbefore"`
// Marker
// The marker line template.
// C({mark}) will be replaced with the values in C(marker_begin) (default="BEGIN") and C(marker_end) (default="END").
// Using a custom marker without the C({mark}) variable may result in the block being repeatedly inserted on subsequent playbook runs.
//
// Default: # {mark} ANSIBLE MANAGED BLOCK
// Required: false
Marker string `yaml:"marker,omitempty" json:"marker,omitempty" cty:"marker"`
// MarkerBegin
// This will be inserted at C({mark}) in the opening ansible block marker.
//
// Default: BEGIN
// Required: false
MarkerBegin string `yaml:"marker_begin,omitempty" json:"marker_begin,omitempty" cty:"marker_begin"`
// MarkerEnd
// This will be inserted at C({mark}) in the closing ansible block marker.
//
// Default: END
// Required: false
MarkerEnd string `yaml:"marker_end,omitempty" json:"marker_end,omitempty" cty:"marker_end"`
// Path
// The file to modify.
// Before Ansible 2.3 this option was only usable as I(dest), I(destfile) and I(name).
//
// Default: <no value>
// Required: true
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// State
// Whether the block should be there or not.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// contains filtered or unexported fields
}
func (*BlockinfileParams) Get ¶ added in v0.0.6
func (p *BlockinfileParams) Get(name string) (interface{}, error)
func (*BlockinfileParams) Names ¶ added in v0.0.6
func (p *BlockinfileParams) Names() []string
func (*BlockinfileParams) Set ¶ added in v0.0.6
func (p *BlockinfileParams) Set(name string, value interface{}) error
type BlockinfileResult ¶
type BlockinfileResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*BlockinfileResult) Get ¶ added in v0.0.6
func (r *BlockinfileResult) Get(name string) (interface{}, error)
func (*BlockinfileResult) Names ¶ added in v0.0.6
func (r *BlockinfileResult) Names() []string
func (*BlockinfileResult) Set ¶ added in v0.0.6
func (r *BlockinfileResult) Set(name string, value interface{}) error
type Command ¶
type Command struct {
Params CommandParams
Result CommandResult
}
Command (command) - Execute commands on targets
The C(command) module takes the command name followed by a list of space-delimited arguments.
The given command will be executed on all selected nodes.
The command(s) will not be processed through the shell, so variables like C($HOSTNAME) and operations like C("*"), C("<"), C(">"), C("|"), C(";") and C("&") will not work. Use the M(ansible.builtin.shell) module if you need these features.
To create C(command) tasks that are easier to read than the ones using space-delimited arguments, pass parameters using the C(args) L(task keyword,../reference_appendices/playbooks_keywords.html#task) or use C(cmd) parameter.
Either a free form command or C(cmd) parameter is required, see the examples.
For Windows targets, use the M(ansible.windows.win_command) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/command.py
func (*Command) GetCommonResult ¶ added in v0.0.3
func (m *Command) GetCommonResult() types.CommonReturn
func (*Command) GetResultRaw ¶
type CommandParams ¶
type CommandParams struct {
// Argv
// Passes the command as a list rather than a string.
// Use C(argv) to avoid quoting values that would otherwise be interpreted incorrectly (for example "user name").
// Only the string (free form) or the list (argv) form can be provided, not both. One or the other must be provided.
//
// Default: <no value>
// Required: false
Argv []string `yaml:"argv,omitempty" json:"argv,omitempty" cty:"argv"`
// Chdir
// Change into this directory before running the command.
//
// Default: <no value>
// Required: false
Chdir string `yaml:"chdir,omitempty" json:"chdir,omitempty" cty:"chdir"`
// Cmd
// The command to run.
//
// Default: <no value>
// Required: false
Cmd string `yaml:"cmd,omitempty" json:"cmd,omitempty" cty:"cmd"`
// Creates
// A filename or (since 2.0) glob pattern. If a matching file already exists, this step B(will not) be run.
// This is checked before I(removes) is checked.
//
// Default: <no value>
// Required: false
Creates string `yaml:"creates,omitempty" json:"creates,omitempty" cty:"creates"`
// FreeForm
// The command module takes a free form string as a command to run.
// There is no actual parameter named 'free form'.
//
// Default: <no value>
// Required: false
FreeForm string `yaml:"free_form,omitempty" json:"free_form,omitempty" cty:"free_form"`
// Removes
// A filename or (since 2.0) glob pattern. If a matching file exists, this step B(will) be run.
// This is checked after I(creates) is checked.
//
// Default: <no value>
// Required: false
Removes string `yaml:"removes,omitempty" json:"removes,omitempty" cty:"removes"`
// Stdin
// Set the stdin of the command directly to the specified value.
//
// Default: <no value>
// Required: false
Stdin string `yaml:"stdin,omitempty" json:"stdin,omitempty" cty:"stdin"`
// StdinAddNewline
// If set to C(yes), append a newline to stdin data.
//
// Default: yes
// Required: false
StdinAddNewline bool `yaml:"stdin_add_newline,omitempty" json:"stdin_add_newline,omitempty" cty:"stdin_add_newline"`
// StripEmptyEnds
// Strip empty lines from the end of stdout/stderr in result.
//
// Default: yes
// Required: false
StripEmptyEnds bool `yaml:"strip_empty_ends,omitempty" json:"strip_empty_ends,omitempty" cty:"strip_empty_ends"`
// Warn
// (deprecated) Enable or disable task warnings.
// This feature is deprecated and will be removed in 2.14.
// As of version 2.11, this option is now disabled by default.
//
// Default: no
// Required: false
Warn bool `yaml:"warn,omitempty" json:"warn,omitempty" cty:"warn"`
// contains filtered or unexported fields
}
func (*CommandParams) Get ¶ added in v0.0.6
func (p *CommandParams) Get(name string) (interface{}, error)
func (*CommandParams) Names ¶ added in v0.0.6
func (p *CommandParams) Names() []string
func (*CommandParams) Set ¶ added in v0.0.6
func (p *CommandParams) Set(name string, value interface{}) error
type CommandResult ¶
type CommandResult struct {
types.CommonReturn
Raw string
// Cmd
// The command executed by the task.
Cmd []string `yaml:"cmd,omitempty" json:"cmd,omitempty" cty:"cmd"`
// Delta
// The command execution delta time.
Delta string `yaml:"delta,omitempty" json:"delta,omitempty" cty:"delta"`
// End
// The command execution end time.
End string `yaml:"end,omitempty" json:"end,omitempty" cty:"end"`
// Rc
// The command return code (0 means success).
Rc int `yaml:"rc,omitempty" json:"rc,omitempty" cty:"rc"`
// Start
// The command execution start time.
Start string `yaml:"start,omitempty" json:"start,omitempty" cty:"start"`
// Stderr
// The command standard error.
Stderr string `yaml:"stderr,omitempty" json:"stderr,omitempty" cty:"stderr"`
// StderrLines
// The command standard error split in lines.
StderrLines []string `yaml:"stderr_lines,omitempty" json:"stderr_lines,omitempty" cty:"stderr_lines"`
// Stdout
// The command standard output.
Stdout string `yaml:"stdout,omitempty" json:"stdout,omitempty" cty:"stdout"`
// StdoutLines
// The command standard output split in lines.
StdoutLines []string `yaml:"stdout_lines,omitempty" json:"stdout_lines,omitempty" cty:"stdout_lines"`
// contains filtered or unexported fields
}
func (*CommandResult) Get ¶ added in v0.0.6
func (r *CommandResult) Get(name string) (interface{}, error)
func (*CommandResult) Names ¶ added in v0.0.6
func (r *CommandResult) Names() []string
func (*CommandResult) Set ¶ added in v0.0.6
func (r *CommandResult) Set(name string, value interface{}) error
type Cron ¶
type Cron struct {
Params CronParams
Result CronResult
}
Cron (cron) - Manage cron.d and crontab entries
Use this module to manage crontab and environment variables entries. This module allows you to create environment variables and named crontab entries, update, or delete them.
When crontab jobs are managed: the module includes one line with the description of the crontab entry C("#Ansible: <name>") corresponding to the "name" passed to the module, which is used by future ansible/module calls to find/check the state. The "name" parameter should be unique, and changing the "name" value will result in a new cron task being created (or a different one being removed).
When environment variables are managed, no comment line is added, but, when the module needs to find/check the state, it uses the "name" parameter to find the environment variable definition line.
When using symbols such as %, they must be properly escaped.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/cron.py
func (*Cron) GetCommonResult ¶ added in v0.0.3
func (m *Cron) GetCommonResult() types.CommonReturn
func (*Cron) GetResultRaw ¶
type CronParams ¶
type CronParams struct {
// Backup
// If set, create a backup of the crontab before it is modified. The location of the backup is returned in the C(backup_file) variable by this module.
//
// Default: no
// Required: false
Backup bool `yaml:"backup,omitempty" json:"backup,omitempty" cty:"backup"`
// CronFile
// If specified, uses this file instead of an individual user's crontab. The assumption is that this file is exclusively managed by the module, do not use if the file contains multiple entries, NEVER use for /etc/crontab.
// If this is a relative path, it is interpreted with respect to I(/etc/cron.d).
// Many linux distros expect (and some require) the filename portion to consist solely of upper- and lower-case letters, digits, underscores, and hyphens.
// Using this parameter requires you to specify the I(user) as well, unless I(state) is not I(present).
// Either this parameter or I(name) is required
//
// Default: <no value>
// Required: false
CronFile string `yaml:"cron_file,omitempty" json:"cron_file,omitempty" cty:"cron_file"`
// Day
// Day of the month the job should run (C(1-31), C(*), C(*/2), and so on).
//
// Default: *
// Required: false
Day string `yaml:"day,omitempty" json:"day,omitempty" cty:"day"`
// Disabled
// If the job should be disabled (commented out) in the crontab.
// Only has effect if I(state=present).
//
// Default: no
// Required: false
Disabled bool `yaml:"disabled,omitempty" json:"disabled,omitempty" cty:"disabled"`
// Env
// If set, manages a crontab's environment variable.
// New variables are added on top of crontab.
// I(name) and I(value) parameters are the name and the value of environment variable.
//
// Default: false
// Required: false
Env bool `yaml:"env,omitempty" json:"env,omitempty" cty:"env"`
// Hour
// Hour when the job should run (C(0-23), C(*), C(*/2), and so on).
//
// Default: *
// Required: false
Hour string `yaml:"hour,omitempty" json:"hour,omitempty" cty:"hour"`
// Insertafter
// Used with I(state=present) and I(env).
// If specified, the environment variable will be inserted after the declaration of specified environment variable.
//
// Default: <no value>
// Required: false
Insertafter string `yaml:"insertafter,omitempty" json:"insertafter,omitempty" cty:"insertafter"`
// Insertbefore
// Used with I(state=present) and I(env).
// If specified, the environment variable will be inserted before the declaration of specified environment variable.
//
// Default: <no value>
// Required: false
Insertbefore string `yaml:"insertbefore,omitempty" json:"insertbefore,omitempty" cty:"insertbefore"`
// Job
// The command to execute or, if env is set, the value of environment variable.
// The command should not contain line breaks.
// Required if I(state=present).
//
// Default: <no value>
// Required: false
Job string `yaml:"job,omitempty" json:"job,omitempty" cty:"job"`
// Minute
// Minute when the job should run (C(0-59), C(*), C(*/2), and so on).
//
// Default: *
// Required: false
Minute string `yaml:"minute,omitempty" json:"minute,omitempty" cty:"minute"`
// Month
// Month of the year the job should run (C(1-12), C(*), C(*/2), and so on).
//
// Default: *
// Required: false
Month string `yaml:"month,omitempty" json:"month,omitempty" cty:"month"`
// Name
// Description of a crontab entry or, if env is set, the name of environment variable.
// This parameter is always required as of ansible-core 2.12.
//
// Default: <no value>
// Required: true
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// SpecialTime
// Special time specification nickname.
//
// Default: <no value>
// Required: false
SpecialTime string `yaml:"special_time,omitempty" json:"special_time,omitempty" cty:"special_time"`
// State
// Whether to ensure the job or environment variable is present or absent.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// User
// The specific user whose crontab should be modified.
// When unset, this parameter defaults to the current user.
//
// Default: <no value>
// Required: false
User string `yaml:"user,omitempty" json:"user,omitempty" cty:"user"`
// Weekday
// Day of the week that the job should run (C(0-6) for Sunday-Saturday, C(*), and so on).
//
// Default: *
// Required: false
Weekday string `yaml:"weekday,omitempty" json:"weekday,omitempty" cty:"weekday"`
// contains filtered or unexported fields
}
func (*CronParams) Get ¶ added in v0.0.6
func (p *CronParams) Get(name string) (interface{}, error)
func (*CronParams) Names ¶ added in v0.0.6
func (p *CronParams) Names() []string
func (*CronParams) Set ¶ added in v0.0.6
func (p *CronParams) Set(name string, value interface{}) error
type CronResult ¶
type CronResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*CronResult) Get ¶ added in v0.0.6
func (r *CronResult) Get(name string) (interface{}, error)
func (*CronResult) Names ¶ added in v0.0.6
func (r *CronResult) Names() []string
func (*CronResult) Set ¶ added in v0.0.6
func (r *CronResult) Set(name string, value interface{}) error
type Debconf ¶
type Debconf struct {
Params DebconfParams
Result DebconfResult
}
Debconf (debconf) - Configure a .deb package
Configure a .deb package using debconf-set-selections.
Or just query existing selections.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/debconf.py
func (*Debconf) GetCommonResult ¶ added in v0.0.3
func (m *Debconf) GetCommonResult() types.CommonReturn
func (*Debconf) GetResultRaw ¶
type DebconfParams ¶
type DebconfParams struct {
// Name
// Name of package to configure.
//
// Default: <no value>
// Required: true
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Question
// A debconf configuration setting.
//
// Default: <no value>
// Required: false
Question string `yaml:"question,omitempty" json:"question,omitempty" cty:"question"`
// Unseen
// Do not set 'seen' flag when pre-seeding.
//
// Default: false
// Required: false
Unseen bool `yaml:"unseen,omitempty" json:"unseen,omitempty" cty:"unseen"`
// Value
// Value to set the configuration to.
//
// Default: <no value>
// Required: false
Value string `yaml:"value,omitempty" json:"value,omitempty" cty:"value"`
// Vtype
// The type of the value supplied.
// It is highly recommended to add I(no_log=True) to task while specifying I(vtype=password).
// C(seen) was added in Ansible 2.2.
//
// Default: <no value>
// Required: false
Vtype string `yaml:"vtype,omitempty" json:"vtype,omitempty" cty:"vtype"`
// contains filtered or unexported fields
}
func (*DebconfParams) Get ¶ added in v0.0.6
func (p *DebconfParams) Get(name string) (interface{}, error)
func (*DebconfParams) Names ¶ added in v0.0.6
func (p *DebconfParams) Names() []string
func (*DebconfParams) Set ¶ added in v0.0.6
func (p *DebconfParams) Set(name string, value interface{}) error
type DebconfResult ¶
type DebconfResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*DebconfResult) Get ¶ added in v0.0.6
func (r *DebconfResult) Get(name string) (interface{}, error)
func (*DebconfResult) Names ¶ added in v0.0.6
func (r *DebconfResult) Names() []string
func (*DebconfResult) Set ¶ added in v0.0.6
func (r *DebconfResult) Set(name string, value interface{}) error
type Dnf ¶
Dnf (dnf) - Manages packages with the I(dnf) package manager
Installs, upgrade, removes, and lists packages and groups with the I(dnf) package manager.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/dnf.py
func (*Dnf) GetCommonResult ¶ added in v0.0.3
func (m *Dnf) GetCommonResult() types.CommonReturn
func (*Dnf) GetResultRaw ¶
type DnfParams ¶
type DnfParams struct {
// AllowDowngrade
// Specify if the named package and version is allowed to downgrade a maybe already installed higher version of that package. Note that setting allow_downgrade=True can make this module behave in a non-idempotent way. The task could end up with a set of packages that does not match the complete list of specified packages to install (because dependencies between the downgraded package and others can cause changes to the packages which were in the earlier transaction).
//
// Default: no
// Required: false
AllowDowngrade bool `yaml:"allow_downgrade,omitempty" json:"allow_downgrade,omitempty" cty:"allow_downgrade"`
// Allowerasing
// If C(yes) it allows erasing of installed packages to resolve dependencies.
//
// Default: no
// Required: false
Allowerasing bool `yaml:"allowerasing,omitempty" json:"allowerasing,omitempty" cty:"allowerasing"`
// Autoremove
// If C(yes), removes all "leaf" packages from the system that were originally installed as dependencies of user-installed packages but which are no longer required by any such package. Should be used alone or when state is I(absent)
//
// Default: no
// Required: false
Autoremove bool `yaml:"autoremove,omitempty" json:"autoremove,omitempty" cty:"autoremove"`
// Bugfix
// If set to C(yes), and C(state=latest) then only installs updates that have been marked bugfix related.
// Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
//
// Default: no
// Required: false
Bugfix bool `yaml:"bugfix,omitempty" json:"bugfix,omitempty" cty:"bugfix"`
// Cacheonly
// Tells dnf to run entirely from system cache; does not download or update metadata.
//
// Default: no
// Required: false
Cacheonly bool `yaml:"cacheonly,omitempty" json:"cacheonly,omitempty" cty:"cacheonly"`
// ConfFile
// The remote dnf configuration file to use for the transaction.
//
// Default: <no value>
// Required: false
ConfFile string `yaml:"conf_file,omitempty" json:"conf_file,omitempty" cty:"conf_file"`
// DisableExcludes
// Disable the excludes defined in DNF config files.
// If set to C(all), disables all excludes.
// If set to C(main), disable excludes defined in [main] in dnf.conf.
// If set to C(repoid), disable excludes defined for given repo id.
//
// Default: <no value>
// Required: false
DisableExcludes string `yaml:"disable_excludes,omitempty" json:"disable_excludes,omitempty" cty:"disable_excludes"`
// DisableGpgCheck
// Whether to disable the GPG checking of signatures of packages being installed. Has an effect only if state is I(present) or I(latest).
// This setting affects packages installed from a repository as well as "local" packages installed from the filesystem or a URL.
//
// Default: no
// Required: false
DisableGpgCheck bool `yaml:"disable_gpg_check,omitempty" json:"disable_gpg_check,omitempty" cty:"disable_gpg_check"`
// DisablePlugin
// I(Plugin) name to disable for the install/update operation. The disabled plugins will not persist beyond the transaction.
//
// Default: <no value>
// Required: false
DisablePlugin []string `yaml:"disable_plugin,omitempty" json:"disable_plugin,omitempty" cty:"disable_plugin"`
// Disablerepo
// I(Repoid) of repositories to disable for the install/update operation. These repos will not persist beyond the transaction. When specifying multiple repos, separate them with a ",".
//
// Default: <no value>
// Required: false
Disablerepo []string `yaml:"disablerepo,omitempty" json:"disablerepo,omitempty" cty:"disablerepo"`
// DownloadDir
// Specifies an alternate directory to store packages.
// Has an effect only if I(download_only) is specified.
//
// Default: <no value>
// Required: false
DownloadDir string `yaml:"download_dir,omitempty" json:"download_dir,omitempty" cty:"download_dir"`
// DownloadOnly
// Only download the packages, do not install them.
//
// Default: no
// Required: false
DownloadOnly bool `yaml:"download_only,omitempty" json:"download_only,omitempty" cty:"download_only"`
// EnablePlugin
// I(Plugin) name to enable for the install/update operation. The enabled plugin will not persist beyond the transaction.
//
// Default: <no value>
// Required: false
EnablePlugin []string `yaml:"enable_plugin,omitempty" json:"enable_plugin,omitempty" cty:"enable_plugin"`
// Enablerepo
// I(Repoid) of repositories to enable for the install/update operation. These repos will not persist beyond the transaction. When specifying multiple repos, separate them with a ",".
//
// Default: <no value>
// Required: false
Enablerepo []string `yaml:"enablerepo,omitempty" json:"enablerepo,omitempty" cty:"enablerepo"`
// Exclude
// Package name(s) to exclude when state=present, or latest. This can be a list or a comma separated string.
//
// Default: <no value>
// Required: false
Exclude []string `yaml:"exclude,omitempty" json:"exclude,omitempty" cty:"exclude"`
// InstallRepoquery
// This is effectively a no-op in DNF as it is not needed with DNF, but is an accepted parameter for feature parity/compatibility with the I(yum) module.
//
// Default: yes
// Required: false
InstallRepoquery bool `yaml:"install_repoquery,omitempty" json:"install_repoquery,omitempty" cty:"install_repoquery"`
// InstallWeakDeps
// Will also install all packages linked by a weak dependency relation.
//
// Default: yes
// Required: false
InstallWeakDeps bool `yaml:"install_weak_deps,omitempty" json:"install_weak_deps,omitempty" cty:"install_weak_deps"`
// Installroot
// Specifies an alternative installroot, relative to which all packages will be installed.
//
// Default: /
// Required: false
Installroot string `yaml:"installroot,omitempty" json:"installroot,omitempty" cty:"installroot"`
// List
// Various (non-idempotent) commands for usage with C(/usr/bin/ansible) and I(not) playbooks. See examples.
//
// Default: <no value>
// Required: false
List string `yaml:"list,omitempty" json:"list,omitempty" cty:"list"`
// LockTimeout
// Amount of time to wait for the dnf lockfile to be freed.
//
// Default: 30
// Required: false
LockTimeout int `yaml:"lock_timeout,omitempty" json:"lock_timeout,omitempty" cty:"lock_timeout"`
// Name
// A package name or package specifier with version, like C(name-1.0). When using state=latest, this can be '*' which means run: dnf -y update. You can also pass a url or a local path to a rpm file. To operate on several packages this can accept a comma separated string of packages or a list of packages.
// Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name>=1.0)
// You can also pass an absolute path for a binary which is provided by the package to install. See examples for more information.
//
// Default: <no value>
// Required: true
Name []string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Nobest
// Set best option to False, so that transactions are not limited to best candidates only.
//
// Default: no
// Required: false
Nobest bool `yaml:"nobest,omitempty" json:"nobest,omitempty" cty:"nobest"`
// Releasever
// Specifies an alternative release from which all packages will be installed.
//
// Default: <no value>
// Required: false
Releasever string `yaml:"releasever,omitempty" json:"releasever,omitempty" cty:"releasever"`
// Security
// If set to C(yes), and C(state=latest) then only installs updates that have been marked security related.
// Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
//
// Default: no
// Required: false
Security bool `yaml:"security,omitempty" json:"security,omitempty" cty:"security"`
// SkipBroken
// Skip all unavailable packages or packages with broken dependencies without raising an error. Equivalent to passing the --skip-broken option.
//
// Default: no
// Required: false
SkipBroken bool `yaml:"skip_broken,omitempty" json:"skip_broken,omitempty" cty:"skip_broken"`
// Sslverify
// Disables SSL validation of the repository server for this transaction.
// This should be set to C(no) if one of the configured repositories is using an untrusted or self-signed certificate.
//
// Default: yes
// Required: false
Sslverify bool `yaml:"sslverify,omitempty" json:"sslverify,omitempty" cty:"sslverify"`
// State
// Whether to install (C(present), C(latest)), or remove (C(absent)) a package.
// Default is C(None), however in effect the default action is C(present) unless the C(autoremove) option is enabled for this module, then C(absent) is inferred.
//
// Default: <no value>
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// UpdateCache
// Force dnf to check if cache is out of date and redownload if needed. Has an effect only if state is I(present) or I(latest).
//
// Default: no
// Required: false
UpdateCache bool `yaml:"update_cache,omitempty" json:"update_cache,omitempty" cty:"update_cache"`
// UpdateOnly
// When using latest, only update installed packages. Do not install packages.
// Has an effect only if state is I(latest)
//
// Default: no
// Required: false
UpdateOnly bool `yaml:"update_only,omitempty" json:"update_only,omitempty" cty:"update_only"`
// ValidateCerts
// This only applies if using a https url as the source of the rpm. e.g. for localinstall. If set to C(no), the SSL certificates will not be validated.
// This should only set to C(no) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
//
// Default: yes
// Required: false
ValidateCerts bool `yaml:"validate_certs,omitempty" json:"validate_certs,omitempty" cty:"validate_certs"`
// contains filtered or unexported fields
}
type DnfResult ¶
type DnfResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
type DpkgSelections ¶
type DpkgSelections struct {
Params DpkgSelectionsParams
Result DpkgSelectionsResult
}
DpkgSelections (dpkg_selections) - Dpkg package selection selections
Change dpkg package selection state via --get-selections and --set-selections.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/dpkg_selections.py
func NewDpkgSelections ¶
func NewDpkgSelections() *DpkgSelections
DpkgSelections (dpkg_selections) - Dpkg package selection selections
func (*DpkgSelections) GetCommonResult ¶ added in v0.0.3
func (m *DpkgSelections) GetCommonResult() types.CommonReturn
func (*DpkgSelections) GetParams ¶
func (m *DpkgSelections) GetParams() types.Params
func (*DpkgSelections) GetResult ¶
func (m *DpkgSelections) GetResult() types.Result
func (*DpkgSelections) GetResultRaw ¶
func (m *DpkgSelections) GetResultRaw() string
func (*DpkgSelections) GetType ¶
func (m *DpkgSelections) GetType() string
type DpkgSelectionsParams ¶
type DpkgSelectionsParams struct {
// Name
// Name of the package.
//
// Default: <no value>
// Required: true
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Selection
// The selection state to set the package to.
//
// Default: <no value>
// Required: true
Selection string `yaml:"selection,omitempty" json:"selection,omitempty" cty:"selection"`
// contains filtered or unexported fields
}
func (*DpkgSelectionsParams) Get ¶ added in v0.0.6
func (p *DpkgSelectionsParams) Get(name string) (interface{}, error)
func (*DpkgSelectionsParams) Names ¶ added in v0.0.6
func (p *DpkgSelectionsParams) Names() []string
func (*DpkgSelectionsParams) Set ¶ added in v0.0.6
func (p *DpkgSelectionsParams) Set(name string, value interface{}) error
type DpkgSelectionsResult ¶
type DpkgSelectionsResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*DpkgSelectionsResult) Get ¶ added in v0.0.6
func (r *DpkgSelectionsResult) Get(name string) (interface{}, error)
func (*DpkgSelectionsResult) Names ¶ added in v0.0.6
func (r *DpkgSelectionsResult) Names() []string
func (*DpkgSelectionsResult) Set ¶ added in v0.0.6
func (r *DpkgSelectionsResult) Set(name string, value interface{}) error
type Expect ¶
type Expect struct {
Params ExpectParams
Result ExpectResult
}
Expect (expect) - Executes a command and responds to prompts
The C(expect) module executes a command and responds to prompts.
The given command will be executed on all selected nodes. It will not be processed through the shell, so variables like C($HOME) and operations like C("<"), C(">"), C("|"), and C("&") will not work.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/expect.py
func NewExpect ¶
func NewExpect() *Expect
Expect (expect) - Executes a command and responds to prompts
func (*Expect) GetCommonResult ¶ added in v0.0.3
func (m *Expect) GetCommonResult() types.CommonReturn
func (*Expect) GetResultRaw ¶
type ExpectParams ¶
type ExpectParams struct {
// Chdir
// Change into this directory before running the command.
//
// Default: <no value>
// Required: false
Chdir string `yaml:"chdir,omitempty" json:"chdir,omitempty" cty:"chdir"`
// Command
// The command module takes command to run.
//
// Default: <no value>
// Required: true
Command string `yaml:"command,omitempty" json:"command,omitempty" cty:"command"`
// Creates
// A filename, when it already exists, this step will B(not) be run.
//
// Default: <no value>
// Required: false
Creates string `yaml:"creates,omitempty" json:"creates,omitempty" cty:"creates"`
// Echo
// Whether or not to echo out your response strings.
//
// Default: false
// Required: false
Echo bool `yaml:"echo,omitempty" json:"echo,omitempty" cty:"echo"`
// Removes
// A filename, when it does not exist, this step will B(not) be run.
//
// Default: <no value>
// Required: false
Removes string `yaml:"removes,omitempty" json:"removes,omitempty" cty:"removes"`
// Responses
// Mapping of expected string/regex and string to respond with. If the response is a list, successive matches return successive responses. List functionality is new in 2.1.
//
// Default: <no value>
// Required: true
Responses map[string]string `yaml:"responses,omitempty" json:"responses,omitempty" cty:"responses"`
// Timeout
// Amount of time in seconds to wait for the expected strings. Use C(null) to disable timeout.
//
// Default: 30
// Required: false
Timeout int `yaml:"timeout,omitempty" json:"timeout,omitempty" cty:"timeout"`
// contains filtered or unexported fields
}
func (*ExpectParams) Get ¶ added in v0.0.6
func (p *ExpectParams) Get(name string) (interface{}, error)
func (*ExpectParams) Names ¶ added in v0.0.6
func (p *ExpectParams) Names() []string
func (*ExpectParams) Set ¶ added in v0.0.6
func (p *ExpectParams) Set(name string, value interface{}) error
type ExpectResult ¶
type ExpectResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*ExpectResult) Get ¶ added in v0.0.6
func (r *ExpectResult) Get(name string) (interface{}, error)
func (*ExpectResult) Names ¶ added in v0.0.6
func (r *ExpectResult) Names() []string
func (*ExpectResult) Set ¶ added in v0.0.6
func (r *ExpectResult) Set(name string, value interface{}) error
type File ¶
type File struct {
Params FileParams
Result FileResult
}
File (file) - Manage files and file properties
Set attributes of files, symlinks or directories.
Alternatively, remove files, symlinks or directories.
Many other modules support the same options as the C(file) module - including M(ansible.builtin.copy), M(ansible.builtin.template), and M(ansible.builtin.assemble).
For Windows targets, use the M(ansible.windows.win_file) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/file.py
func (*File) GetCommonResult ¶ added in v0.0.3
func (m *File) GetCommonResult() types.CommonReturn
func (*File) GetResultRaw ¶
type FileParams ¶
type FileParams struct {
// AccessTime
// This parameter indicates the time the file's access time should be set to.
// Should be C(preserve) when no modification is required, C(YYYYMMDDHHMM.SS) when using default time format, or C(now).
// Default is C(None) meaning that C(preserve) is the default for C(state=[file,directory,link,hard]) and C(now) is default for C(state=touch).
//
// Default: <no value>
// Required: false
AccessTime string `yaml:"access_time,omitempty" json:"access_time,omitempty" cty:"access_time"`
// AccessTimeFormat
// When used with C(access_time), indicates the time format that must be used.
// Based on default Python format (see time.strftime doc).
//
// Default: %Y%m%d%H%M.%S
// Required: false
AccessTimeFormat string `yaml:"access_time_format,omitempty" json:"access_time_format,omitempty" cty:"access_time_format"`
// Follow
// This flag indicates that filesystem links, if they exist, should be followed.
// Previous to Ansible 2.5, this was C(no) by default.
//
// Default: yes
// Required: false
Follow bool `yaml:"follow,omitempty" json:"follow,omitempty" cty:"follow"`
//
// Default: no
// Required: false
Force bool `yaml:"force,omitempty" json:"force,omitempty" cty:"force"`
// ModificationTime
// This parameter indicates the time the file's modification time should be set to.
// Should be C(preserve) when no modification is required, C(YYYYMMDDHHMM.SS) when using default time format, or C(now).
// Default is None meaning that C(preserve) is the default for C(state=[file,directory,link,hard]) and C(now) is default for C(state=touch).
//
// Default: <no value>
// Required: false
ModificationTime string `yaml:"modification_time,omitempty" json:"modification_time,omitempty" cty:"modification_time"`
// ModificationTimeFormat
// When used with C(modification_time), indicates the time format that must be used.
// Based on default Python format (see time.strftime doc).
//
// Default: %Y%m%d%H%M.%S
// Required: false
ModificationTimeFormat string `yaml:"modification_time_format,omitempty" json:"modification_time_format,omitempty" cty:"modification_time_format"`
// Path
// Path to the file being managed.
//
// Default: <no value>
// Required: true
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// Recurse
// Recursively set the specified file attributes on directory contents.
// This applies only when C(state) is set to C(directory).
//
// Default: no
// Required: false
Recurse bool `yaml:"recurse,omitempty" json:"recurse,omitempty" cty:"recurse"`
// Src
// Path of the file to link to.
// This applies only to C(state=link) and C(state=hard).
// For C(state=link), this will also accept a non-existing path.
// Relative paths are relative to the file being created (C(path)) which is how the Unix command C(ln -s SRC DEST) treats relative paths.
//
// Default: <no value>
// Required: false
Src string `yaml:"src,omitempty" json:"src,omitempty" cty:"src"`
// State
// If C(absent), directories will be recursively deleted, and files or symlinks will be unlinked. In the case of a directory, if C(diff) is declared, you will see the files and folders deleted listed under C(path_contents). Note that C(absent) will not cause C(file) to fail if the C(path) does not exist as the state did not change.
// If C(directory), all intermediate subdirectories will be created if they do not exist. Since Ansible 1.7 they will be created with the supplied permissions.
// If C(file), with no other options, returns the current state of C(path).
// If C(file), even with other options (such as C(mode)), the file will be modified if it exists but will NOT be created if it does not exist. Set to C(touch) or use the M(ansible.builtin.copy) or M(ansible.builtin.template) module if you want to create the file if it does not exist.
// If C(hard), the hard link will be created or changed.
// If C(link), the symbolic link will be created or changed.
// If C(touch) (new in 1.4), an empty file will be created if the file does not exist, while an existing file or directory will receive updated file access and modification times (similar to the way C(touch) works from the command line).
//
// Default: file
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// contains filtered or unexported fields
}
func (*FileParams) Get ¶ added in v0.0.6
func (p *FileParams) Get(name string) (interface{}, error)
func (*FileParams) Names ¶ added in v0.0.6
func (p *FileParams) Names() []string
func (*FileParams) Set ¶ added in v0.0.6
func (p *FileParams) Set(name string, value interface{}) error
type FileResult ¶
type FileResult struct {
types.CommonReturn
Raw string
// Dest
// Destination file/path, equal to the value passed to I(path).
Dest string `yaml:"dest,omitempty" json:"dest,omitempty" cty:"dest"`
// Path
// Destination file/path, equal to the value passed to I(path).
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// contains filtered or unexported fields
}
func (*FileResult) Get ¶ added in v0.0.6
func (r *FileResult) Get(name string) (interface{}, error)
func (*FileResult) Names ¶ added in v0.0.6
func (r *FileResult) Names() []string
func (*FileResult) Set ¶ added in v0.0.6
func (r *FileResult) Set(name string, value interface{}) error
type Find ¶
type Find struct {
Params FindParams
Result FindResult
}
Find (find) - Return a list of files based on specific criteria
Return a list of files based on specific criteria. Multiple criteria are AND'd together.
For Windows targets, use the M(ansible.windows.win_find) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/find.py
func (*Find) GetCommonResult ¶ added in v0.0.3
func (m *Find) GetCommonResult() types.CommonReturn
func (*Find) GetResultRaw ¶
type FindParams ¶
type FindParams struct {
// Age
// Select files whose age is equal to or greater than the specified time.
// Use a negative age to find files equal to or less than the specified time.
// You can choose seconds, minutes, hours, days, or weeks by specifying the first letter of any of those words (e.g., "1w").
//
// Default: <no value>
// Required: false
Age string `yaml:"age,omitempty" json:"age,omitempty" cty:"age"`
// AgeStamp
// Choose the file property against which we compare age.
//
// Default: mtime
// Required: false
AgeStamp string `yaml:"age_stamp,omitempty" json:"age_stamp,omitempty" cty:"age_stamp"`
// Contains
// A regular expression or pattern which should be matched against the file content.
// Works only when I(file_type) is C(file).
//
// Default: <no value>
// Required: false
Contains string `yaml:"contains,omitempty" json:"contains,omitempty" cty:"contains"`
// Depth
// Set the maximum number of levels to descend into.
// Setting recurse to C(no) will override this value, which is effectively depth 1.
// Default is unlimited depth.
//
// Default: <no value>
// Required: false
Depth int `yaml:"depth,omitempty" json:"depth,omitempty" cty:"depth"`
// Excludes
// One or more (shell or regex) patterns, which type is controlled by C(use_regex) option.
// Items whose basenames match an C(excludes) pattern are culled from C(patterns) matches. Multiple patterns can be specified using a list.
//
// Default: <no value>
// Required: false
Excludes []string `yaml:"excludes,omitempty" json:"excludes,omitempty" cty:"excludes"`
// FileType
// Type of file to select.
// The 'link' and 'any' choices were added in Ansible 2.3.
//
// Default: file
// Required: false
FileType string `yaml:"file_type,omitempty" json:"file_type,omitempty" cty:"file_type"`
// Follow
// Set this to C(yes) to follow symlinks in path for systems with python 2.6+.
//
// Default: no
// Required: false
Follow bool `yaml:"follow,omitempty" json:"follow,omitempty" cty:"follow"`
// GetChecksum
// Set this to C(yes) to retrieve a file's SHA1 checksum.
//
// Default: no
// Required: false
GetChecksum bool `yaml:"get_checksum,omitempty" json:"get_checksum,omitempty" cty:"get_checksum"`
// Hidden
// Set this to C(yes) to include hidden files, otherwise they will be ignored.
//
// Default: no
// Required: false
Hidden bool `yaml:"hidden,omitempty" json:"hidden,omitempty" cty:"hidden"`
// Paths
// List of paths of directories to search. All paths must be fully qualified.
//
// Default: <no value>
// Required: true
Paths []string `yaml:"paths,omitempty" json:"paths,omitempty" cty:"paths"`
// Patterns
// One or more (shell or regex) patterns, which type is controlled by C(use_regex) option.
// The patterns restrict the list of files to be returned to those whose basenames match at least one of the patterns specified. Multiple patterns can be specified using a list.
// The pattern is matched against the file base name, excluding the directory.
// When using regexen, the pattern MUST match the ENTIRE file name, not just parts of it. So if you are looking to match all files ending in .default, you'd need to use '.*\.default' as a regexp and not just '\.default'.
// This parameter expects a list, which can be either comma separated or YAML. If any of the patterns contain a comma, make sure to put them in a list to avoid splitting the patterns in undesirable ways.
// Defaults to '*' when C(use_regex=False), or '.*' when C(use_regex=True).
//
// Default: []
// Required: false
Patterns []string `yaml:"patterns,omitempty" json:"patterns,omitempty" cty:"patterns"`
// ReadWholeFile
// When doing a C(contains) search, determines whether the whole file should be read into memory or if the regex should be applied to the file line-by-line.
// Setting this to C(true) can have performance and memory implications for large files.
// This uses C(re.search()) instead of C(re.match()).
//
// Default: false
// Required: false
ReadWholeFile bool `yaml:"read_whole_file,omitempty" json:"read_whole_file,omitempty" cty:"read_whole_file"`
// Recurse
// If target is a directory, recursively descend into the directory looking for files.
//
// Default: no
// Required: false
Recurse bool `yaml:"recurse,omitempty" json:"recurse,omitempty" cty:"recurse"`
// Size
// Select files whose size is equal to or greater than the specified size.
// Use a negative size to find files equal to or less than the specified size.
// Unqualified values are in bytes but b, k, m, g, and t can be appended to specify bytes, kilobytes, megabytes, gigabytes, and terabytes, respectively.
// Size is not evaluated for directories.
//
// Default: <no value>
// Required: false
Size string `yaml:"size,omitempty" json:"size,omitempty" cty:"size"`
// UseRegex
// If C(no), the patterns are file globs (shell).
// If C(yes), they are python regexes.
//
// Default: no
// Required: false
UseRegex bool `yaml:"use_regex,omitempty" json:"use_regex,omitempty" cty:"use_regex"`
// contains filtered or unexported fields
}
func (*FindParams) Get ¶ added in v0.0.6
func (p *FindParams) Get(name string) (interface{}, error)
func (*FindParams) Names ¶ added in v0.0.6
func (p *FindParams) Names() []string
func (*FindParams) Set ¶ added in v0.0.6
func (p *FindParams) Set(name string, value interface{}) error
type FindResult ¶
type FindResult struct {
types.CommonReturn
Raw string
// Examined
// Number of filesystem objects looked at
Examined int `yaml:"examined,omitempty" json:"examined,omitempty" cty:"examined"`
// Files
// All matches found with the specified criteria (see stat module for full output of each dictionary)
Files []string `yaml:"files,omitempty" json:"files,omitempty" cty:"files"`
// Matched
// Number of matches
Matched int `yaml:"matched,omitempty" json:"matched,omitempty" cty:"matched"`
// SkippedPaths
// skipped paths and reasons they were skipped
SkippedPaths map[string]string `yaml:"skipped_paths,omitempty" json:"skipped_paths,omitempty" cty:"skipped_paths"`
// contains filtered or unexported fields
}
func (*FindResult) Get ¶ added in v0.0.6
func (r *FindResult) Get(name string) (interface{}, error)
func (*FindResult) Names ¶ added in v0.0.6
func (r *FindResult) Names() []string
func (*FindResult) Set ¶ added in v0.0.6
func (r *FindResult) Set(name string, value interface{}) error
type GetUrl ¶
type GetUrl struct {
Params GetUrlParams
Result GetUrlResult
}
GetUrl (get_url) - Downloads files from HTTP, HTTPS, or FTP to node
Downloads files from HTTP, HTTPS, or FTP to the remote server. The remote server I(must) have direct access to the remote resource.
By default, if an environment variable C(<protocol>_proxy) is set on the target host, requests will be sent through that proxy. This behaviour can be overridden by setting a variable for this task (see R(setting the environment,playbooks_environment)), or by using the use_proxy option.
HTTP redirects can redirect from HTTP to HTTPS so you should be sure that your proxy environment for both protocols is correct.
From Ansible 2.4 when run with C(--check), it will do a HEAD request to validate the URL but will not download the entire file or verify it against hashes and will report incorrect changed status.
For Windows targets, use the M(ansible.windows.win_get_url) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/get_url.py
func NewGetUrl ¶
func NewGetUrl() *GetUrl
GetUrl (get_url) - Downloads files from HTTP, HTTPS, or FTP to node
func (*GetUrl) GetCommonResult ¶ added in v0.0.3
func (m *GetUrl) GetCommonResult() types.CommonReturn
func (*GetUrl) GetResultRaw ¶
type GetUrlParams ¶
type GetUrlParams struct {
// Backup
// Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
//
// Default: no
// Required: false
Backup bool `yaml:"backup,omitempty" json:"backup,omitempty" cty:"backup"`
// Checksum
// If a checksum is passed to this parameter, the digest of the destination file will be calculated after it is downloaded to ensure its integrity and verify that the transfer completed successfully. Format: <algorithm>:<checksum|url>, e.g. checksum="sha256:D98291AC[...]B6DC7B97", checksum="sha256:http://example.com/path/sha256sum.txt"
// If you worry about portability, only the sha1 algorithm is available on all platforms and python versions.
// The third party hashlib library can be installed for access to additional algorithms.
// Additionally, if a checksum is passed to this parameter, and the file exist under the C(dest) location, the I(destination_checksum) would be calculated, and if checksum equals I(destination_checksum), the file download would be skipped (unless C(force) is true). If the checksum does not equal I(destination_checksum), the destination file is deleted.
//
// Default:
// Required: false
Checksum string `yaml:"checksum,omitempty" json:"checksum,omitempty" cty:"checksum"`
// ClientCert
// PEM formatted certificate chain file to be used for SSL client authentication.
// This file can also include the key as well, and if the key is included, C(client_key) is not required.
//
// Default: <no value>
// Required: false
ClientCert string `yaml:"client_cert,omitempty" json:"client_cert,omitempty" cty:"client_cert"`
// ClientKey
// PEM formatted file that contains your private key to be used for SSL client authentication.
// If C(client_cert) contains both the certificate and key, this option is not required.
//
// Default: <no value>
// Required: false
ClientKey string `yaml:"client_key,omitempty" json:"client_key,omitempty" cty:"client_key"`
// Dest
// Absolute path of where to download the file to.
// If C(dest) is a directory, either the server provided filename or, if none provided, the base name of the URL on the remote server will be used. If a directory, C(force) has no effect.
// If C(dest) is a directory, the file will always be downloaded (regardless of the C(force) and C(checksum) option), but replaced only if the contents changed.
//
// Default: <no value>
// Required: true
Dest string `yaml:"dest,omitempty" json:"dest,omitempty" cty:"dest"`
// Force
// If C(yes) and C(dest) is not a directory, will download the file every time and replace the file if the contents change. If C(no), the file will only be downloaded if the destination does not exist. Generally should be C(yes) only for small local files.
// Prior to 0.6, this module behaved as if C(yes) was the default.
//
// Default: no
// Required: false
Force bool `yaml:"force,omitempty" json:"force,omitempty" cty:"force"`
// ForceBasicAuth
// Force the sending of the Basic authentication header upon initial request.
// httplib2, the library used by the uri module only sends authentication information when a webservice responds to an initial request with a 401 status. Since some basic auth services do not properly send a 401, logins will fail.
//
// Default: no
// Required: false
ForceBasicAuth bool `yaml:"force_basic_auth,omitempty" json:"force_basic_auth,omitempty" cty:"force_basic_auth"`
// Headers
// Add custom HTTP headers to a request in hash/dict format.
// The hash/dict format was added in Ansible 2.6.
// Previous versions used a C("key:value,key:value") string format.
// The C("key:value,key:value") string format is deprecated and has been removed in version 2.10.
//
// Default: <no value>
// Required: false
Headers map[string]string `yaml:"headers,omitempty" json:"headers,omitempty" cty:"headers"`
// HttpAgent
// Header to identify as, generally appears in web server logs.
//
// Default: ansible-httpget
// Required: false
HttpAgent string `yaml:"http_agent,omitempty" json:"http_agent,omitempty" cty:"http_agent"`
// Sha256sum
// If a SHA-256 checksum is passed to this parameter, the digest of the destination file will be calculated after it is downloaded to ensure its integrity and verify that the transfer completed successfully. This option is deprecated and will be removed in version 2.14. Use option C(checksum) instead.
//
// Default:
// Required: false
Sha256sum string `yaml:"sha256sum,omitempty" json:"sha256sum,omitempty" cty:"sha256sum"`
// Timeout
// Timeout in seconds for URL request.
//
// Default: 10
// Required: false
Timeout int `yaml:"timeout,omitempty" json:"timeout,omitempty" cty:"timeout"`
// TmpDest
// Absolute path of where temporary file is downloaded to.
// When run on Ansible 2.5 or greater, path defaults to ansible's remote_tmp setting
// When run on Ansible prior to 2.5, it defaults to C(TMPDIR), C(TEMP) or C(TMP) env variables or a platform specific value.
// U(https://docs.python.org/3/library/tempfile.html#tempfile.tempdir)
//
// Default: <no value>
// Required: false
TmpDest string `yaml:"tmp_dest,omitempty" json:"tmp_dest,omitempty" cty:"tmp_dest"`
// UnredirectedHeaders
// A list of header names that will not be sent on subsequent redirected requests. This list is case insensitive. By default all headers will be redirected. In some cases it may be beneficial to list headers such as C(Authorization) here to avoid potential credential exposure.
//
// Default: []
// Required: false
UnredirectedHeaders []string `yaml:"unredirected_headers,omitempty" json:"unredirected_headers,omitempty" cty:"unredirected_headers"`
// Url
// HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path
//
// Default: <no value>
// Required: true
Url string `yaml:"url,omitempty" json:"url,omitempty" cty:"url"`
// UrlPassword
// The password for use in HTTP basic authentication.
// If the C(url_username) parameter is not specified, the C(url_password) parameter will not be used.
// Since version 2.8 you can also use the 'password' alias for this option.
//
// Default: <no value>
// Required: false
UrlPassword string `yaml:"url_password,omitempty" json:"url_password,omitempty" cty:"url_password"`
// UrlUsername
// The username for use in HTTP basic authentication.
// This parameter can be used without C(url_password) for sites that allow empty passwords.
// Since version 2.8 you can also use the C(username) alias for this option.
//
// Default: <no value>
// Required: false
UrlUsername string `yaml:"url_username,omitempty" json:"url_username,omitempty" cty:"url_username"`
// UseGssapi
// Use GSSAPI to perform the authentication, typically this is for Kerberos or Kerberos through Negotiate authentication.
// Requires the Python library L(gssapi,https://github.com/pythongssapi/python-gssapi) to be installed.
// Credentials for GSSAPI can be specified with I(url_username)/I(url_password) or with the GSSAPI env var C(KRB5CCNAME) that specified a custom Kerberos credential cache.
// NTLM authentication is I(not) supported even if the GSSAPI mech for NTLM has been installed.
//
// Default: no
// Required: false
UseGssapi bool `yaml:"use_gssapi,omitempty" json:"use_gssapi,omitempty" cty:"use_gssapi"`
// UseProxy
// if C(no), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
//
// Default: yes
// Required: false
UseProxy bool `yaml:"use_proxy,omitempty" json:"use_proxy,omitempty" cty:"use_proxy"`
// ValidateCerts
// If C(no), SSL certificates will not be validated.
// This should only be used on personally controlled sites using self-signed certificates.
//
// Default: yes
// Required: false
ValidateCerts bool `yaml:"validate_certs,omitempty" json:"validate_certs,omitempty" cty:"validate_certs"`
// contains filtered or unexported fields
}
func (*GetUrlParams) Get ¶ added in v0.0.6
func (p *GetUrlParams) Get(name string) (interface{}, error)
func (*GetUrlParams) Names ¶ added in v0.0.6
func (p *GetUrlParams) Names() []string
func (*GetUrlParams) Set ¶ added in v0.0.6
func (p *GetUrlParams) Set(name string, value interface{}) error
type GetUrlResult ¶
type GetUrlResult struct {
types.CommonReturn
Raw string
// BackupFile
// name of backup file created after download
BackupFile string `yaml:"backup_file,omitempty" json:"backup_file,omitempty" cty:"backup_file"`
// ChecksumDest
// sha1 checksum of the file after copy
ChecksumDest string `yaml:"checksum_dest,omitempty" json:"checksum_dest,omitempty" cty:"checksum_dest"`
// ChecksumSrc
// sha1 checksum of the file
ChecksumSrc string `yaml:"checksum_src,omitempty" json:"checksum_src,omitempty" cty:"checksum_src"`
// Dest
// destination file/path
Dest string `yaml:"dest,omitempty" json:"dest,omitempty" cty:"dest"`
// Elapsed
// The number of seconds that elapsed while performing the download
Elapsed int `yaml:"elapsed,omitempty" json:"elapsed,omitempty" cty:"elapsed"`
// Gid
// group id of the file
Gid int `yaml:"gid,omitempty" json:"gid,omitempty" cty:"gid"`
// Group
// group of the file
Group string `yaml:"group,omitempty" json:"group,omitempty" cty:"group"`
// Md5sum
// md5 checksum of the file after download
Md5sum string `yaml:"md5sum,omitempty" json:"md5sum,omitempty" cty:"md5sum"`
// Mode
// permissions of the target
Mode string `yaml:"mode,omitempty" json:"mode,omitempty" cty:"mode"`
// Msg
// the HTTP message from the request
Msg string `yaml:"msg,omitempty" json:"msg,omitempty" cty:"msg"`
// Owner
// owner of the file
Owner string `yaml:"owner,omitempty" json:"owner,omitempty" cty:"owner"`
// Secontext
// the SELinux security context of the file
Secontext string `yaml:"secontext,omitempty" json:"secontext,omitempty" cty:"secontext"`
// Size
// size of the target
Size int `yaml:"size,omitempty" json:"size,omitempty" cty:"size"`
// Src
// source file used after download
Src string `yaml:"src,omitempty" json:"src,omitempty" cty:"src"`
// State
// state of the target
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// StatusCode
// the HTTP status code from the request
StatusCode int `yaml:"status_code,omitempty" json:"status_code,omitempty" cty:"status_code"`
// Uid
// owner id of the file, after execution
Uid int `yaml:"uid,omitempty" json:"uid,omitempty" cty:"uid"`
// Url
// the actual URL used for the request
Url string `yaml:"url,omitempty" json:"url,omitempty" cty:"url"`
// contains filtered or unexported fields
}
func (*GetUrlResult) Get ¶ added in v0.0.6
func (r *GetUrlResult) Get(name string) (interface{}, error)
func (*GetUrlResult) Names ¶ added in v0.0.6
func (r *GetUrlResult) Names() []string
func (*GetUrlResult) Set ¶ added in v0.0.6
func (r *GetUrlResult) Set(name string, value interface{}) error
type Getent ¶
type Getent struct {
Params GetentParams
Result GetentResult
}
Getent (getent) - A wrapper to the unix getent utility
Runs getent against one of it's various databases and returns information into the host's facts, in a getent_<database> prefixed variable.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/getent.py
func (*Getent) GetCommonResult ¶ added in v0.0.3
func (m *Getent) GetCommonResult() types.CommonReturn
func (*Getent) GetResultRaw ¶
type GetentParams ¶
type GetentParams struct {
// Database
// The name of a getent database supported by the target system (passwd, group, hosts, etc).
//
// Default: <no value>
// Required: true
Database string `yaml:"database,omitempty" json:"database,omitempty" cty:"database"`
// FailKey
// If a supplied key is missing this will make the task fail if C(yes).
//
// Default: yes
// Required: false
FailKey bool `yaml:"fail_key,omitempty" json:"fail_key,omitempty" cty:"fail_key"`
// Key
// Key from which to return values from the specified database, otherwise the full contents are returned.
//
// Default:
// Required: false
Key string `yaml:"key,omitempty" json:"key,omitempty" cty:"key"`
// Service
// Override all databases with the specified service
// The underlying system must support the service flag which is not always available.
//
// Default: <no value>
// Required: false
Service string `yaml:"service,omitempty" json:"service,omitempty" cty:"service"`
// Split
// Character used to split the database values into lists/arrays such as ':' or ' ', otherwise it will try to pick one depending on the database.
//
// Default: <no value>
// Required: false
Split string `yaml:"split,omitempty" json:"split,omitempty" cty:"split"`
// contains filtered or unexported fields
}
func (*GetentParams) Get ¶ added in v0.0.6
func (p *GetentParams) Get(name string) (interface{}, error)
func (*GetentParams) Names ¶ added in v0.0.6
func (p *GetentParams) Names() []string
func (*GetentParams) Set ¶ added in v0.0.6
func (p *GetentParams) Set(name string, value interface{}) error
type GetentResult ¶
type GetentResult struct {
types.CommonReturn
Raw string
// AnsibleFacts
// Facts to add to ansible_facts.
AnsibleFacts map[string]string `yaml:"ansible_facts,omitempty" json:"ansible_facts,omitempty" cty:"ansible_facts"`
// contains filtered or unexported fields
}
func (*GetentResult) Get ¶ added in v0.0.6
func (r *GetentResult) Get(name string) (interface{}, error)
func (*GetentResult) Names ¶ added in v0.0.6
func (r *GetentResult) Names() []string
func (*GetentResult) Set ¶ added in v0.0.6
func (r *GetentResult) Set(name string, value interface{}) error
type Git ¶
Git (git) - Deploy software (or files) from git checkouts
Manage I(git) checkouts of repositories to deploy files or software.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/git.py
func (*Git) GetCommonResult ¶ added in v0.0.3
func (m *Git) GetCommonResult() types.CommonReturn
func (*Git) GetResultRaw ¶
type GitParams ¶
type GitParams struct {
// AcceptHostkey
// Will ensure or not that "-o StrictHostKeyChecking=no" is present as an ssh option.
// Be aware that this disables a protection against MITM attacks.
// Those using OpenSSH >= 7.5 might want to set I(ssh_opt) to 'StrictHostKeyChecking=accept-new' instead, it does not remove the MITM issue but it does restrict it to the first attempt.
//
// Default: no
// Required: false
AcceptHostkey bool `yaml:"accept_hostkey,omitempty" json:"accept_hostkey,omitempty" cty:"accept_hostkey"`
// AcceptNewhostkey
// As of OpenSSH 7.5, "-o StrictHostKeyChecking=accept-new" can be used which is safer and will only accepts host keys which are not present or are the same. if C(yes), ensure that "-o StrictHostKeyChecking=accept-new" is present as an ssh option.
//
// Default: no
// Required: false
AcceptNewhostkey bool `yaml:"accept_newhostkey,omitempty" json:"accept_newhostkey,omitempty" cty:"accept_newhostkey"`
// Archive
// Specify archive file path with extension. If specified, creates an archive file of the specified format containing the tree structure for the source tree. Allowed archive formats ["zip", "tar.gz", "tar", "tgz"].
// This will clone and perform git archive from local directory as not all git servers support git archive.
//
// Default: <no value>
// Required: false
Archive string `yaml:"archive,omitempty" json:"archive,omitempty" cty:"archive"`
// ArchivePrefix
// Specify a prefix to add to each file path in archive. Requires I(archive) to be specified.
//
// Default: <no value>
// Required: false
ArchivePrefix string `yaml:"archive_prefix,omitempty" json:"archive_prefix,omitempty" cty:"archive_prefix"`
// Bare
// If C(yes), repository will be created as a bare repo, otherwise it will be a standard repo with a workspace.
//
// Default: no
// Required: false
Bare bool `yaml:"bare,omitempty" json:"bare,omitempty" cty:"bare"`
// Clone
// If C(no), do not clone the repository even if it does not exist locally.
//
// Default: yes
// Required: false
Clone bool `yaml:"clone,omitempty" json:"clone,omitempty" cty:"clone"`
// Depth
// Create a shallow clone with a history truncated to the specified number or revisions. The minimum possible value is C(1), otherwise ignored. Needs I(git>=1.9.1) to work correctly.
//
// Default: <no value>
// Required: false
Depth int `yaml:"depth,omitempty" json:"depth,omitempty" cty:"depth"`
// Dest
// The path of where the repository should be checked out. This is equivalent to C(git clone [repo_url] [directory]). The repository named in I(repo) is not appended to this path and the destination directory must be empty. This parameter is required, unless I(clone) is set to C(no).
//
// Default: <no value>
// Required: true
Dest string `yaml:"dest,omitempty" json:"dest,omitempty" cty:"dest"`
// Executable
// Path to git executable to use. If not supplied, the normal mechanism for resolving binary paths will be used.
//
// Default: <no value>
// Required: false
Executable string `yaml:"executable,omitempty" json:"executable,omitempty" cty:"executable"`
// Force
// If C(yes), any modified files in the working repository will be discarded. Prior to 0.7, this was always C(yes) and could not be disabled. Prior to 1.9, the default was C(yes).
//
// Default: no
// Required: false
Force bool `yaml:"force,omitempty" json:"force,omitempty" cty:"force"`
// GpgWhitelist
// A list of trusted GPG fingerprints to compare to the fingerprint of the GPG-signed commit.
// Only used when I(verify_commit=yes).
// Use of this feature requires Git 2.6+ due to its reliance on git's C(--raw) flag to C(verify-commit) and C(verify-tag).
//
// Default: []
// Required: false
GpgWhitelist []string `yaml:"gpg_whitelist,omitempty" json:"gpg_whitelist,omitempty" cty:"gpg_whitelist"`
// KeyFile
// Specify an optional private key file path, on the target host, to use for the checkout.
// This ensures 'IdentitiesOnly=yes' is present in ssh_opts.
//
// Default: <no value>
// Required: false
KeyFile string `yaml:"key_file,omitempty" json:"key_file,omitempty" cty:"key_file"`
// Recursive
// If C(no), repository will be cloned without the --recursive option, skipping sub-modules.
//
// Default: yes
// Required: false
Recursive bool `yaml:"recursive,omitempty" json:"recursive,omitempty" cty:"recursive"`
// Reference
// Reference repository (see "git clone --reference ...").
//
// Default: <no value>
// Required: false
Reference string `yaml:"reference,omitempty" json:"reference,omitempty" cty:"reference"`
// Refspec
// Add an additional refspec to be fetched. If version is set to a I(SHA-1) not reachable from any branch or tag, this option may be necessary to specify the ref containing the I(SHA-1). Uses the same syntax as the C(git fetch) command. An example value could be "refs/meta/config".
//
// Default: <no value>
// Required: false
Refspec string `yaml:"refspec,omitempty" json:"refspec,omitempty" cty:"refspec"`
// Remote
// Name of the remote.
//
// Default: origin
// Required: false
Remote string `yaml:"remote,omitempty" json:"remote,omitempty" cty:"remote"`
// Repo
// git, SSH, or HTTP(S) protocol address of the git repository.
//
// Default: <no value>
// Required: true
Repo string `yaml:"repo,omitempty" json:"repo,omitempty" cty:"repo"`
// SeparateGitDir
// The path to place the cloned repository. If specified, Git repository can be separated from working tree.
//
// Default: <no value>
// Required: false
SeparateGitDir string `yaml:"separate_git_dir,omitempty" json:"separate_git_dir,omitempty" cty:"separate_git_dir"`
// SingleBranch
// Clone only the history leading to the tip of the specified revision.
//
// Default: no
// Required: false
SingleBranch bool `yaml:"single_branch,omitempty" json:"single_branch,omitempty" cty:"single_branch"`
// SshOpts
// Options git will pass to ssh when used as protocol, it works via C(git)'s GIT_SSH/GIT_SSH_COMMAND environment variables.
// For older versions it appends GIT_SSH_OPTS (specific to this module) to the variables above or via a wrapper script.
// Other options can add to this list, like I(key_file) and I(accept_hostkey).
// An example value could be "-o StrictHostKeyChecking=no" (although this particular option is better set by I(accept_hostkey)).
// The module ensures that 'BatchMode=yes' is always present to avoid prompts.
//
// Default: <no value>
// Required: false
SshOpts string `yaml:"ssh_opts,omitempty" json:"ssh_opts,omitempty" cty:"ssh_opts"`
// TrackSubmodules
// If C(yes), submodules will track the latest commit on their master branch (or other branch specified in .gitmodules). If C(no), submodules will be kept at the revision specified by the main project. This is equivalent to specifying the --remote flag to git submodule update.
//
// Default: no
// Required: false
TrackSubmodules bool `yaml:"track_submodules,omitempty" json:"track_submodules,omitempty" cty:"track_submodules"`
// Umask
// The umask to set before doing any checkouts, or any other repository maintenance.
//
// Default: <no value>
// Required: false
Umask string `yaml:"umask,omitempty" json:"umask,omitempty" cty:"umask"`
// Update
// If C(no), do not retrieve new revisions from the origin repository.
// Operations like archive will work on the existing (old) repository and might not respond to changes to the options version or remote.
//
// Default: yes
// Required: false
Update bool `yaml:"update,omitempty" json:"update,omitempty" cty:"update"`
// VerifyCommit
// If C(yes), when cloning or checking out a I(version) verify the signature of a GPG signed commit. This requires git version>=2.1.0 to be installed. The commit MUST be signed and the public key MUST be present in the GPG keyring.
//
// Default: no
// Required: false
VerifyCommit bool `yaml:"verify_commit,omitempty" json:"verify_commit,omitempty" cty:"verify_commit"`
// Version
// What version of the repository to check out. This can be the literal string C(HEAD), a branch name, a tag name. It can also be a I(SHA-1) hash, in which case I(refspec) needs to be specified if the given revision is not already available.
//
// Default: HEAD
// Required: false
Version string `yaml:"version,omitempty" json:"version,omitempty" cty:"version"`
// contains filtered or unexported fields
}
type GitResult ¶
type GitResult struct {
types.CommonReturn
Raw string
// After
// Last commit revision of the repository retrieved during the update.
After string `yaml:"after,omitempty" json:"after,omitempty" cty:"after"`
// Before
// Commit revision before the repository was updated, "null" for new repository.
Before string `yaml:"before,omitempty" json:"before,omitempty" cty:"before"`
// GitDirBefore
// Contains the original path of .git directory if it is changed.
GitDirBefore string `yaml:"git_dir_before,omitempty" json:"git_dir_before,omitempty" cty:"git_dir_before"`
// GitDirNow
// Contains the new path of .git directory if it is changed.
GitDirNow string `yaml:"git_dir_now,omitempty" json:"git_dir_now,omitempty" cty:"git_dir_now"`
// RemoteUrlChanged
// Contains True or False whether or not the remote URL was changed.
RemoteUrlChanged bool `yaml:"remote_url_changed,omitempty" json:"remote_url_changed,omitempty" cty:"remote_url_changed"`
// Warnings
// List of warnings if requested features were not available due to a too old git version.
Warnings string `yaml:"warnings,omitempty" json:"warnings,omitempty" cty:"warnings"`
// contains filtered or unexported fields
}
type Group ¶
type Group struct {
Params GroupParams
Result GroupResult
}
Group (group) - Add or remove groups
Manage presence of groups on a host.
For Windows targets, use the M(ansible.windows.win_group) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/group.py
func (*Group) GetCommonResult ¶ added in v0.0.3
func (m *Group) GetCommonResult() types.CommonReturn
func (*Group) GetResultRaw ¶
type GroupParams ¶
type GroupParams struct {
// Gid
// Optional I(GID) to set for the group.
//
// Default: <no value>
// Required: false
Gid int `yaml:"gid,omitempty" json:"gid,omitempty" cty:"gid"`
// Local
// Forces the use of "local" command alternatives on platforms that implement it.
// This is useful in environments that use centralized authentication when you want to manipulate the local groups. (for example, it uses C(lgroupadd) instead of C(groupadd)).
// This requires that these commands exist on the targeted host, otherwise it will be a fatal error.
//
// Default: no
// Required: false
Local bool `yaml:"local,omitempty" json:"local,omitempty" cty:"local"`
// Name
// Name of the group to manage.
//
// Default: <no value>
// Required: true
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// NonUnique
// This option allows to change the group ID to a non-unique value. Requires C(gid).
// Not supported on macOS or BusyBox distributions.
//
// Default: no
// Required: false
NonUnique bool `yaml:"non_unique,omitempty" json:"non_unique,omitempty" cty:"non_unique"`
// State
// Whether the group should be present or not on the remote host.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// System
// If I(yes), indicates that the group created is a system group.
//
// Default: no
// Required: false
System bool `yaml:"system,omitempty" json:"system,omitempty" cty:"system"`
// contains filtered or unexported fields
}
func (*GroupParams) Get ¶ added in v0.0.6
func (p *GroupParams) Get(name string) (interface{}, error)
func (*GroupParams) Names ¶ added in v0.0.6
func (p *GroupParams) Names() []string
func (*GroupParams) Set ¶ added in v0.0.6
func (p *GroupParams) Set(name string, value interface{}) error
type GroupResult ¶
type GroupResult struct {
types.CommonReturn
Raw string
// Gid
// Group ID of the group.
Gid int `yaml:"gid,omitempty" json:"gid,omitempty" cty:"gid"`
// Name
// Group name.
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// State
// Whether the group is present or not.
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// System
// Whether the group is a system group or not.
System bool `yaml:"system,omitempty" json:"system,omitempty" cty:"system"`
// contains filtered or unexported fields
}
func (*GroupResult) Get ¶ added in v0.0.6
func (r *GroupResult) Get(name string) (interface{}, error)
func (*GroupResult) Names ¶ added in v0.0.6
func (r *GroupResult) Names() []string
func (*GroupResult) Set ¶ added in v0.0.6
func (r *GroupResult) Set(name string, value interface{}) error
type Hostname ¶
type Hostname struct {
Params HostnameParams
Result HostnameResult
}
Hostname (hostname) - Manage hostname
Set system's hostname. Supports most OSs/Distributions including those using C(systemd).
Windows, HP-UX, and AIX are not currently supported.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/hostname.py
func (*Hostname) GetCommonResult ¶ added in v0.0.3
func (m *Hostname) GetCommonResult() types.CommonReturn
func (*Hostname) GetResultRaw ¶
type HostnameParams ¶
type HostnameParams struct {
// Name
// Name of the host.
// If the value is a fully qualified domain name that does not resolve from the given host, this will cause the module to hang for a few seconds while waiting for the name resolution attempt to timeout.
//
// Default: <no value>
// Required: true
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Use
// Which strategy to use to update the hostname.
// If not set we try to autodetect, but this can be problematic, particularly with containers as they can present misleading information.
// Note that 'systemd' should be specified for RHEL/EL/CentOS 7+. Older distributions should use 'redhat'.
//
// Default: <no value>
// Required: false
Use string `yaml:"use,omitempty" json:"use,omitempty" cty:"use"`
// contains filtered or unexported fields
}
func (*HostnameParams) Get ¶ added in v0.0.6
func (p *HostnameParams) Get(name string) (interface{}, error)
func (*HostnameParams) Names ¶ added in v0.0.6
func (p *HostnameParams) Names() []string
func (*HostnameParams) Set ¶ added in v0.0.6
func (p *HostnameParams) Set(name string, value interface{}) error
type HostnameResult ¶
type HostnameResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*HostnameResult) Get ¶ added in v0.0.6
func (r *HostnameResult) Get(name string) (interface{}, error)
func (*HostnameResult) Names ¶ added in v0.0.6
func (r *HostnameResult) Names() []string
func (*HostnameResult) Set ¶ added in v0.0.6
func (r *HostnameResult) Set(name string, value interface{}) error
type Iptables ¶
type Iptables struct {
Params IptablesParams
Result IptablesResult
}
Iptables (iptables) - Modify iptables rules
C(iptables) is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel.
This module does not handle the saving and/or loading of rules, but rather only manipulates the current rules that are present in memory. This is the same as the behaviour of the C(iptables) and C(ip6tables) command which this module uses internally.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/iptables.py
func (*Iptables) GetCommonResult ¶ added in v0.0.3
func (m *Iptables) GetCommonResult() types.CommonReturn
func (*Iptables) GetResultRaw ¶
type IptablesParams ¶
type IptablesParams struct {
// Action
// Whether the rule should be appended at the bottom or inserted at the top.
// If the rule already exists the chain will not be modified.
//
// Default: append
// Required: false
Action string `yaml:"action,omitempty" json:"action,omitempty" cty:"action"`
// Chain
// Specify the iptables chain to modify.
// This could be a user-defined chain or one of the standard iptables chains, like C(INPUT), C(FORWARD), C(OUTPUT), C(PREROUTING), C(POSTROUTING), C(SECMARK) or C(CONNSECMARK).
//
// Default: <no value>
// Required: false
Chain string `yaml:"chain,omitempty" json:"chain,omitempty" cty:"chain"`
// ChainManagement
// If C(true) and C(state) is C(present), the chain will be created if needed.
// If C(true) and C(state) is C(absent), the chain will be deleted if the only other parameter passed are C(chain) and optionally C(table).
//
// Default: false
// Required: false
ChainManagement bool `yaml:"chain_management,omitempty" json:"chain_management,omitempty" cty:"chain_management"`
// Comment
// This specifies a comment that will be added to the rule.
//
// Default: <no value>
// Required: false
Comment string `yaml:"comment,omitempty" json:"comment,omitempty" cty:"comment"`
// Ctstate
// A list of the connection states to match in the conntrack module.
// Possible values are C(INVALID), C(NEW), C(ESTABLISHED), C(RELATED), C(UNTRACKED), C(SNAT), C(DNAT).
//
// Default: []
// Required: false
Ctstate []string `yaml:"ctstate,omitempty" json:"ctstate,omitempty" cty:"ctstate"`
// Destination
// Destination specification.
// Address can be either a network name, a hostname, a network IP address (with /mask), or a plain IP address.
// Hostnames will be resolved once only, before the rule is submitted to the kernel. Please note that specifying any name to be resolved with a remote query such as DNS is a really bad idea.
// The mask can be either a network mask or a plain number, specifying the number of 1's at the left side of the network mask. Thus, a mask of 24 is equivalent to 255.255.255.0. A C(!) argument before the address specification inverts the sense of the address.
//
// Default: <no value>
// Required: false
Destination string `yaml:"destination,omitempty" json:"destination,omitempty" cty:"destination"`
// DestinationPort
// Destination port or port range specification. This can either be a service name or a port number. An inclusive range can also be specified, using the format first:last. If the first port is omitted, '0' is assumed; if the last is omitted, '65535' is assumed. If the first port is greater than the second one they will be swapped. This is only valid if the rule also specifies one of the following protocols: tcp, udp, dccp or sctp.
//
// Default: <no value>
// Required: false
DestinationPort string `yaml:"destination_port,omitempty" json:"destination_port,omitempty" cty:"destination_port"`
// DestinationPorts
// This specifies multiple destination port numbers or port ranges to match in the multiport module.
// It can only be used in conjunction with the protocols tcp, udp, udplite, dccp and sctp.
//
// Default: <no value>
// Required: false
DestinationPorts []string `yaml:"destination_ports,omitempty" json:"destination_ports,omitempty" cty:"destination_ports"`
// DstRange
// Specifies the destination IP range to match in the iprange module.
//
// Default: <no value>
// Required: false
DstRange string `yaml:"dst_range,omitempty" json:"dst_range,omitempty" cty:"dst_range"`
// Flush
// Flushes the specified table and chain of all rules.
// If no chain is specified then the entire table is purged.
// Ignores all other parameters.
//
// Default: false
// Required: false
Flush bool `yaml:"flush,omitempty" json:"flush,omitempty" cty:"flush"`
// Fragment
// This means that the rule only refers to second and further fragments of fragmented packets.
// Since there is no way to tell the source or destination ports of such a packet (or ICMP type), such a packet will not match any rules which specify them.
// When the "!" argument precedes fragment argument, the rule will only match head fragments, or unfragmented packets.
//
// Default: <no value>
// Required: false
Fragment string `yaml:"fragment,omitempty" json:"fragment,omitempty" cty:"fragment"`
// Gateway
// This specifies the IP address of host to send the cloned packets.
// This option is only valid when C(jump) is set to C(TEE).
//
// Default: <no value>
// Required: false
Gateway string `yaml:"gateway,omitempty" json:"gateway,omitempty" cty:"gateway"`
// GidOwner
// Specifies the GID or group to use in match by owner rule.
//
// Default: <no value>
// Required: false
GidOwner string `yaml:"gid_owner,omitempty" json:"gid_owner,omitempty" cty:"gid_owner"`
// Goto
// This specifies that the processing should continue in a user specified chain.
// Unlike the jump argument return will not continue processing in this chain but instead in the chain that called us via jump.
//
// Default: <no value>
// Required: false
Goto string `yaml:"goto,omitempty" json:"goto,omitempty" cty:"goto"`
// IcmpType
// This allows specification of the ICMP type, which can be a numeric ICMP type, type/code pair, or one of the ICMP type names shown by the command 'iptables -p icmp -h'
//
// Default: <no value>
// Required: false
IcmpType string `yaml:"icmp_type,omitempty" json:"icmp_type,omitempty" cty:"icmp_type"`
// InInterface
// Name of an interface via which a packet was received (only for packets entering the C(INPUT), C(FORWARD) and C(PREROUTING) chains).
// When the C(!) argument is used before the interface name, the sense is inverted.
// If the interface name ends in a C(+), then any interface which begins with this name will match.
// If this option is omitted, any interface name will match.
//
// Default: <no value>
// Required: false
InInterface string `yaml:"in_interface,omitempty" json:"in_interface,omitempty" cty:"in_interface"`
// IpVersion
// Which version of the IP protocol this rule should apply to.
//
// Default: ipv4
// Required: false
IpVersion string `yaml:"ip_version,omitempty" json:"ip_version,omitempty" cty:"ip_version"`
// Jump
// This specifies the target of the rule; i.e., what to do if the packet matches it.
// The target can be a user-defined chain (other than the one this rule is in), one of the special builtin targets which decide the fate of the packet immediately, or an extension (see EXTENSIONS below).
// If this option is omitted in a rule (and the goto parameter is not used), then matching the rule will have no effect on the packet's fate, but the counters on the rule will be incremented.
//
// Default: <no value>
// Required: false
Jump string `yaml:"jump,omitempty" json:"jump,omitempty" cty:"jump"`
// Limit
// Specifies the maximum average number of matches to allow per second.
// The number can specify units explicitly, using C(/second), C(/minute), C(/hour) or C(/day), or parts of them (so C(5/second) is the same as C(5/s)).
//
// Default: <no value>
// Required: false
Limit string `yaml:"limit,omitempty" json:"limit,omitempty" cty:"limit"`
// LimitBurst
// Specifies the maximum burst before the above limit kicks in.
//
// Default: <no value>
// Required: false
LimitBurst string `yaml:"limit_burst,omitempty" json:"limit_burst,omitempty" cty:"limit_burst"`
// LogLevel
// Logging level according to the syslogd-defined priorities.
// The value can be strings or numbers from 1-8.
// This parameter is only applicable if C(jump) is set to C(LOG).
//
// Default: <no value>
// Required: false
LogLevel string `yaml:"log_level,omitempty" json:"log_level,omitempty" cty:"log_level"`
// LogPrefix
// Specifies a log text for the rule. Only make sense with a LOG jump.
//
// Default: <no value>
// Required: false
LogPrefix string `yaml:"log_prefix,omitempty" json:"log_prefix,omitempty" cty:"log_prefix"`
// Match
// Specifies a match to use, that is, an extension module that tests for a specific property.
// The set of matches make up the condition under which a target is invoked.
// Matches are evaluated first to last if specified as an array and work in short-circuit fashion, i.e. if one extension yields false, evaluation will stop.
//
// Default: []
// Required: false
Match []string `yaml:"match,omitempty" json:"match,omitempty" cty:"match"`
// MatchSet
// Specifies a set name which can be defined by ipset.
// Must be used together with the match_set_flags parameter.
// When the C(!) argument is prepended then it inverts the rule.
// Uses the iptables set extension.
//
// Default: <no value>
// Required: false
MatchSet string `yaml:"match_set,omitempty" json:"match_set,omitempty" cty:"match_set"`
// MatchSetFlags
// Specifies the necessary flags for the match_set parameter.
// Must be used together with the match_set parameter.
// Uses the iptables set extension.
//
// Default: <no value>
// Required: false
MatchSetFlags string `yaml:"match_set_flags,omitempty" json:"match_set_flags,omitempty" cty:"match_set_flags"`
// OutInterface
// Name of an interface via which a packet is going to be sent (for packets entering the C(FORWARD), C(OUTPUT) and C(POSTROUTING) chains).
// When the C(!) argument is used before the interface name, the sense is inverted.
// If the interface name ends in a C(+), then any interface which begins with this name will match.
// If this option is omitted, any interface name will match.
//
// Default: <no value>
// Required: false
OutInterface string `yaml:"out_interface,omitempty" json:"out_interface,omitempty" cty:"out_interface"`
// Policy
// Set the policy for the chain to the given target.
// Only built-in chains can have policies.
// This parameter requires the C(chain) parameter.
// If you specify this parameter, all other parameters will be ignored.
// This parameter is used to set default policy for the given C(chain). Do not confuse this with C(jump) parameter.
//
// Default: <no value>
// Required: false
Policy string `yaml:"policy,omitempty" json:"policy,omitempty" cty:"policy"`
// Protocol
// The protocol of the rule or of the packet to check.
// The specified protocol can be one of C(tcp), C(udp), C(udplite), C(icmp), C(ipv6-icmp) or C(icmpv6), C(esp), C(ah), C(sctp) or the special keyword C(all), or it can be a numeric value, representing one of these protocols or a different one.
// A protocol name from I(/etc/protocols) is also allowed.
// A C(!) argument before the protocol inverts the test.
// The number zero is equivalent to all.
// C(all) will match with all protocols and is taken as default when this option is omitted.
//
// Default: <no value>
// Required: false
Protocol string `yaml:"protocol,omitempty" json:"protocol,omitempty" cty:"protocol"`
// RejectWith
// Specifies the error packet type to return while rejecting. It implies "jump: REJECT".
//
// Default: <no value>
// Required: false
RejectWith string `yaml:"reject_with,omitempty" json:"reject_with,omitempty" cty:"reject_with"`
// RuleNum
// Insert the rule as the given rule number.
// This works only with C(action=insert).
//
// Default: <no value>
// Required: false
RuleNum string `yaml:"rule_num,omitempty" json:"rule_num,omitempty" cty:"rule_num"`
// SetCounters
// This enables the administrator to initialize the packet and byte counters of a rule (during C(INSERT), C(APPEND), C(REPLACE) operations).
//
// Default: <no value>
// Required: false
SetCounters string `yaml:"set_counters,omitempty" json:"set_counters,omitempty" cty:"set_counters"`
// SetDscpMark
// This allows specifying a DSCP mark to be added to packets. It takes either an integer or hex value.
// Mutually exclusive with C(set_dscp_mark_class).
//
// Default: <no value>
// Required: false
SetDscpMark string `yaml:"set_dscp_mark,omitempty" json:"set_dscp_mark,omitempty" cty:"set_dscp_mark"`
// SetDscpMarkClass
// This allows specifying a predefined DiffServ class which will be translated to the corresponding DSCP mark.
// Mutually exclusive with C(set_dscp_mark).
//
// Default: <no value>
// Required: false
SetDscpMarkClass string `yaml:"set_dscp_mark_class,omitempty" json:"set_dscp_mark_class,omitempty" cty:"set_dscp_mark_class"`
// Source
// Source specification.
// Address can be either a network name, a hostname, a network IP address (with /mask), or a plain IP address.
// Hostnames will be resolved once only, before the rule is submitted to the kernel. Please note that specifying any name to be resolved with a remote query such as DNS is a really bad idea.
// The mask can be either a network mask or a plain number, specifying the number of 1's at the left side of the network mask. Thus, a mask of 24 is equivalent to 255.255.255.0. A C(!) argument before the address specification inverts the sense of the address.
//
// Default: <no value>
// Required: false
Source string `yaml:"source,omitempty" json:"source,omitempty" cty:"source"`
// SourcePort
// Source port or port range specification.
// This can either be a service name or a port number.
// An inclusive range can also be specified, using the format C(first:last).
// If the first port is omitted, C(0) is assumed; if the last is omitted, C(65535) is assumed.
// If the first port is greater than the second one they will be swapped.
//
// Default: <no value>
// Required: false
SourcePort string `yaml:"source_port,omitempty" json:"source_port,omitempty" cty:"source_port"`
// SrcRange
// Specifies the source IP range to match in the iprange module.
//
// Default: <no value>
// Required: false
SrcRange string `yaml:"src_range,omitempty" json:"src_range,omitempty" cty:"src_range"`
// State
// Whether the rule should be absent or present.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// Syn
// This allows matching packets that have the SYN bit set and the ACK and RST bits unset.
// When negated, this matches all packets with the RST or the ACK bits set.
//
// Default: ignore
// Required: false
Syn string `yaml:"syn,omitempty" json:"syn,omitempty" cty:"syn"`
// Table
// This option specifies the packet matching table which the command should operate on.
// If the kernel is configured with automatic module loading, an attempt will be made to load the appropriate module for that table if it is not already there.
//
// Default: filter
// Required: false
Table string `yaml:"table,omitempty" json:"table,omitempty" cty:"table"`
// TcpFlags
// TCP flags specification.
// C(tcp_flags) expects a dict with the two keys C(flags) and C(flags_set).
//
// Default: map[]
// Required: false
TcpFlags map[string]string `yaml:"tcp_flags,omitempty" json:"tcp_flags,omitempty" cty:"tcp_flags"`
// ToDestination
// This specifies a destination address to use with C(DNAT).
// Without this, the destination address is never altered.
//
// Default: <no value>
// Required: false
ToDestination string `yaml:"to_destination,omitempty" json:"to_destination,omitempty" cty:"to_destination"`
// ToPorts
// This specifies a destination port or range of ports to use, without this, the destination port is never altered.
// This is only valid if the rule also specifies one of the protocol C(tcp), C(udp), C(dccp) or C(sctp).
//
// Default: <no value>
// Required: false
ToPorts string `yaml:"to_ports,omitempty" json:"to_ports,omitempty" cty:"to_ports"`
// ToSource
// This specifies a source address to use with C(SNAT).
// Without this, the source address is never altered.
//
// Default: <no value>
// Required: false
ToSource string `yaml:"to_source,omitempty" json:"to_source,omitempty" cty:"to_source"`
// UidOwner
// Specifies the UID or username to use in match by owner rule.
// From Ansible 2.6 when the C(!) argument is prepended then the it inverts the rule to apply instead to all users except that one specified.
//
// Default: <no value>
// Required: false
UidOwner string `yaml:"uid_owner,omitempty" json:"uid_owner,omitempty" cty:"uid_owner"`
// Wait
// Wait N seconds for the xtables lock to prevent multiple instances of the program from running concurrently.
//
// Default: <no value>
// Required: false
Wait string `yaml:"wait,omitempty" json:"wait,omitempty" cty:"wait"`
// contains filtered or unexported fields
}
func (*IptablesParams) Get ¶ added in v0.0.6
func (p *IptablesParams) Get(name string) (interface{}, error)
func (*IptablesParams) Names ¶ added in v0.0.6
func (p *IptablesParams) Names() []string
func (*IptablesParams) Set ¶ added in v0.0.6
func (p *IptablesParams) Set(name string, value interface{}) error
type IptablesResult ¶
type IptablesResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*IptablesResult) Get ¶ added in v0.0.6
func (r *IptablesResult) Get(name string) (interface{}, error)
func (*IptablesResult) Names ¶ added in v0.0.6
func (r *IptablesResult) Names() []string
func (*IptablesResult) Set ¶ added in v0.0.6
func (r *IptablesResult) Set(name string, value interface{}) error
type KnownHosts ¶
type KnownHosts struct {
Params KnownHostsParams
Result KnownHostsResult
}
KnownHosts (known_hosts) - Add or remove a host from the C(known_hosts) file
The C(known_hosts) module lets you add or remove a host keys from the C(known_hosts) file.
Starting at Ansible 2.2, multiple entries per host are allowed, but only one for each key type supported by ssh. This is useful if you're going to want to use the M(ansible.builtin.git) module over ssh, for example.
If you have a very large number of host keys to manage, you will find the M(ansible.builtin.template) module more useful.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/known_hosts.py
func NewKnownHosts ¶
func NewKnownHosts() *KnownHosts
KnownHosts (known_hosts) - Add or remove a host from the C(known_hosts) file
func (*KnownHosts) GetCommonResult ¶ added in v0.0.3
func (m *KnownHosts) GetCommonResult() types.CommonReturn
func (*KnownHosts) GetParams ¶
func (m *KnownHosts) GetParams() types.Params
func (*KnownHosts) GetResult ¶
func (m *KnownHosts) GetResult() types.Result
func (*KnownHosts) GetResultRaw ¶
func (m *KnownHosts) GetResultRaw() string
func (*KnownHosts) GetType ¶
func (m *KnownHosts) GetType() string
type KnownHostsParams ¶
type KnownHostsParams struct {
// HashHost
// Hash the hostname in the known_hosts file.
//
// Default: no
// Required: false
HashHost bool `yaml:"hash_host,omitempty" json:"hash_host,omitempty" cty:"hash_host"`
// Key
// The SSH public host key, as a string.
// Required if C(state=present), optional when C(state=absent), in which case all keys for the host are removed.
// The key must be in the right format for SSH (see sshd(8), section "SSH_KNOWN_HOSTS FILE FORMAT").
// Specifically, the key should not match the format that is found in an SSH pubkey file, but should rather have the hostname prepended to a line that includes the pubkey, the same way that it would appear in the known_hosts file. The value prepended to the line must also match the value of the name parameter.
// Should be of format C(<hostname[,IP]> ssh-rsa <pubkey>).
// For custom SSH port, C(key) needs to specify port as well. See example section.
//
// Default: <no value>
// Required: false
Key string `yaml:"key,omitempty" json:"key,omitempty" cty:"key"`
// Name
// The host to add or remove (must match a host specified in key). It will be converted to lowercase so that ssh-keygen can find it.
// Must match with <hostname> or <ip> present in key attribute.
// For custom SSH port, C(name) needs to specify port as well. See example section.
//
// Default: <no value>
// Required: true
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Path
// The known_hosts file to edit.
// The known_hosts file will be created if needed. The rest of the path must exist prior to running the module.
//
// Default: ~/.ssh/known_hosts
// Required: false
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// State
// I(present) to add the host key.
// I(absent) to remove it.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// contains filtered or unexported fields
}
func (*KnownHostsParams) Get ¶ added in v0.0.6
func (p *KnownHostsParams) Get(name string) (interface{}, error)
func (*KnownHostsParams) Names ¶ added in v0.0.6
func (p *KnownHostsParams) Names() []string
func (*KnownHostsParams) Set ¶ added in v0.0.6
func (p *KnownHostsParams) Set(name string, value interface{}) error
type KnownHostsResult ¶
type KnownHostsResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*KnownHostsResult) Get ¶ added in v0.0.6
func (r *KnownHostsResult) Get(name string) (interface{}, error)
func (*KnownHostsResult) Names ¶ added in v0.0.6
func (r *KnownHostsResult) Names() []string
func (*KnownHostsResult) Set ¶ added in v0.0.6
func (r *KnownHostsResult) Set(name string, value interface{}) error
type Lineinfile ¶
type Lineinfile struct {
Params LineinfileParams
Result LineinfileResult
}
Lineinfile (lineinfile) - Manage lines in text files
This module ensures a particular line is in a file, or replace an existing line using a back-referenced regular expression.
This is primarily useful when you want to change a single line in a file only.
See the M(ansible.builtin.replace) module if you want to change multiple, similar lines or check M(ansible.builtin.blockinfile) if you want to insert/update/remove a block of lines in a file. For other cases, see the M(ansible.builtin.copy) or M(ansible.builtin.template) modules.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/lineinfile.py
func NewLineinfile ¶
func NewLineinfile() *Lineinfile
Lineinfile (lineinfile) - Manage lines in text files
func (*Lineinfile) GetCommonResult ¶ added in v0.0.3
func (m *Lineinfile) GetCommonResult() types.CommonReturn
func (*Lineinfile) GetParams ¶
func (m *Lineinfile) GetParams() types.Params
func (*Lineinfile) GetResult ¶
func (m *Lineinfile) GetResult() types.Result
func (*Lineinfile) GetResultRaw ¶
func (m *Lineinfile) GetResultRaw() string
func (*Lineinfile) GetType ¶
func (m *Lineinfile) GetType() string
type LineinfileParams ¶
type LineinfileParams struct {
// Backrefs
// Used with C(state=present).
// If set, C(line) can contain backreferences (both positional and named) that will get populated if the C(regexp) matches.
// This parameter changes the operation of the module slightly; C(insertbefore) and C(insertafter) will be ignored, and if the C(regexp) does not match anywhere in the file, the file will be left unchanged.
// If the C(regexp) does match, the last matching line will be replaced by the expanded line parameter.
// Mutually exclusive with C(search_string).
//
// Default: no
// Required: false
Backrefs bool `yaml:"backrefs,omitempty" json:"backrefs,omitempty" cty:"backrefs"`
// Backup
// Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
//
// Default: no
// Required: false
Backup bool `yaml:"backup,omitempty" json:"backup,omitempty" cty:"backup"`
// Create
// Used with C(state=present).
// If specified, the file will be created if it does not already exist.
// By default it will fail if the file is missing.
//
// Default: no
// Required: false
Create bool `yaml:"create,omitempty" json:"create,omitempty" cty:"create"`
// Firstmatch
// Used with C(insertafter) or C(insertbefore).
// If set, C(insertafter) and C(insertbefore) will work with the first line that matches the given regular expression.
//
// Default: no
// Required: false
Firstmatch bool `yaml:"firstmatch,omitempty" json:"firstmatch,omitempty" cty:"firstmatch"`
// Insertafter
// Used with C(state=present).
// If specified, the line will be inserted after the last match of specified regular expression.
// If the first match is required, use(firstmatch=yes).
// A special value is available; C(EOF) for inserting the line at the end of the file.
// If specified regular expression has no matches, EOF will be used instead.
// If C(insertbefore) is set, default value C(EOF) will be ignored.
// If regular expressions are passed to both C(regexp) and C(insertafter), C(insertafter) is only honored if no match for C(regexp) is found.
// May not be used with C(backrefs) or C(insertbefore).
//
// Default: EOF
// Required: false
Insertafter string `yaml:"insertafter,omitempty" json:"insertafter,omitempty" cty:"insertafter"`
// Insertbefore
// Used with C(state=present).
// If specified, the line will be inserted before the last match of specified regular expression.
// If the first match is required, use C(firstmatch=yes).
// A value is available; C(BOF) for inserting the line at the beginning of the file.
// If specified regular expression has no matches, the line will be inserted at the end of the file.
// If regular expressions are passed to both C(regexp) and C(insertbefore), C(insertbefore) is only honored if no match for C(regexp) is found.
// May not be used with C(backrefs) or C(insertafter).
//
// Default: <no value>
// Required: false
Insertbefore string `yaml:"insertbefore,omitempty" json:"insertbefore,omitempty" cty:"insertbefore"`
// Line
// The line to insert/replace into the file.
// Required for C(state=present).
// If C(backrefs) is set, may contain backreferences that will get expanded with the C(regexp) capture groups if the regexp matches.
//
// Default: <no value>
// Required: false
Line string `yaml:"line,omitempty" json:"line,omitempty" cty:"line"`
// Others
// All arguments accepted by the M(ansible.builtin.file) module also work here.
//
// Default: <no value>
// Required: false
Others string `yaml:"others,omitempty" json:"others,omitempty" cty:"others"`
// Path
// The file to modify.
// Before Ansible 2.3 this option was only usable as I(dest), I(destfile) and I(name).
//
// Default: <no value>
// Required: true
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// Regexp
// The regular expression to look for in every line of the file.
// For C(state=present), the pattern to replace if found. Only the last line found will be replaced.
// For C(state=absent), the pattern of the line(s) to remove.
// If the regular expression is not matched, the line will be added to the file in keeping with C(insertbefore) or C(insertafter) settings.
// When modifying a line the regexp should typically match both the initial state of the line as well as its state after replacement by C(line) to ensure idempotence.
// Uses Python regular expressions. See U(https://docs.python.org/3/library/re.html).
//
// Default: <no value>
// Required: false
Regexp string `yaml:"regexp,omitempty" json:"regexp,omitempty" cty:"regexp"`
// SearchString
// The literal string to look for in every line of the file. This does not have to match the entire line.
// For C(state=present), the line to replace if the string is found in the file. Only the last line found will be replaced.
// For C(state=absent), the line(s) to remove if the string is in the line.
// If the literal expression is not matched, the line will be added to the file in keeping with C(insertbefore) or C(insertafter) settings.
// Mutually exclusive with C(backrefs) and C(regexp).
//
// Default: <no value>
// Required: false
SearchString string `yaml:"search_string,omitempty" json:"search_string,omitempty" cty:"search_string"`
// State
// Whether the line should be there or not.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// contains filtered or unexported fields
}
func (*LineinfileParams) Get ¶ added in v0.0.6
func (p *LineinfileParams) Get(name string) (interface{}, error)
func (*LineinfileParams) Names ¶ added in v0.0.6
func (p *LineinfileParams) Names() []string
func (*LineinfileParams) Set ¶ added in v0.0.6
func (p *LineinfileParams) Set(name string, value interface{}) error
type LineinfileResult ¶
type LineinfileResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*LineinfileResult) Get ¶ added in v0.0.6
func (r *LineinfileResult) Get(name string) (interface{}, error)
func (*LineinfileResult) Names ¶ added in v0.0.6
func (r *LineinfileResult) Names() []string
func (*LineinfileResult) Set ¶ added in v0.0.6
func (r *LineinfileResult) Set(name string, value interface{}) error
type Pip ¶
Pip (pip) - Manages Python library dependencies
Manage Python library dependencies. To use this module, one of the following keys is required: C(name) or C(requirements).
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/pip.py
func (*Pip) GetCommonResult ¶ added in v0.0.3
func (m *Pip) GetCommonResult() types.CommonReturn
func (*Pip) GetResultRaw ¶
type PipParams ¶
type PipParams struct {
// Chdir
// cd into this directory before running the command
//
// Default: <no value>
// Required: false
Chdir string `yaml:"chdir,omitempty" json:"chdir,omitempty" cty:"chdir"`
// Editable
// Pass the editable flag.
//
// Default: no
// Required: false
Editable bool `yaml:"editable,omitempty" json:"editable,omitempty" cty:"editable"`
// Executable
// The explicit executable or pathname for the pip executable, if different from the Ansible Python interpreter. For example C(pip3.3), if there are both Python 2.7 and 3.3 installations in the system and you want to run pip for the Python 3.3 installation.
// Mutually exclusive with I(virtualenv) (added in 2.1).
// Does not affect the Ansible Python interpreter.
// The setuptools package must be installed for both the Ansible Python interpreter and for the version of Python specified by this option.
//
// Default: <no value>
// Required: false
Executable string `yaml:"executable,omitempty" json:"executable,omitempty" cty:"executable"`
// ExtraArgs
// Extra arguments passed to pip.
//
// Default: <no value>
// Required: false
ExtraArgs string `yaml:"extra_args,omitempty" json:"extra_args,omitempty" cty:"extra_args"`
// Name
// The name of a Python library to install or the url(bzr+,hg+,git+,svn+) of the remote package.
// This can be a list (since 2.2) and contain version specifiers (since 2.7).
//
// Default: <no value>
// Required: false
Name []string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Requirements
// The path to a pip requirements file, which should be local to the remote system. File can be specified as a relative path if using the chdir option.
//
// Default: <no value>
// Required: false
Requirements string `yaml:"requirements,omitempty" json:"requirements,omitempty" cty:"requirements"`
// State
// The state of module
// The 'forcereinstall' option is only available in Ansible 2.1 and above.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// Umask
// The system umask to apply before installing the pip package. This is useful, for example, when installing on systems that have a very restrictive umask by default (e.g., "0077") and you want to pip install packages which are to be used by all users. Note that this requires you to specify desired umask mode as an octal string, (e.g., "0022").
//
// Default: <no value>
// Required: false
Umask string `yaml:"umask,omitempty" json:"umask,omitempty" cty:"umask"`
// Version
// The version number to install of the Python library specified in the I(name) parameter.
//
// Default: <no value>
// Required: false
Version string `yaml:"version,omitempty" json:"version,omitempty" cty:"version"`
// Virtualenv
// An optional path to a I(virtualenv) directory to install into. It cannot be specified together with the 'executable' parameter (added in 2.1). If the virtualenv does not exist, it will be created before installing packages. The optional virtualenv_site_packages, virtualenv_command, and virtualenv_python options affect the creation of the virtualenv.
//
// Default: <no value>
// Required: false
Virtualenv string `yaml:"virtualenv,omitempty" json:"virtualenv,omitempty" cty:"virtualenv"`
// VirtualenvCommand
// The command or a pathname to the command to create the virtual environment with. For example C(pyvenv), C(virtualenv), C(virtualenv2), C(~/bin/virtualenv), C(/usr/local/bin/virtualenv).
//
// Default: virtualenv
// Required: false
VirtualenvCommand string `yaml:"virtualenv_command,omitempty" json:"virtualenv_command,omitempty" cty:"virtualenv_command"`
// VirtualenvPython
// The Python executable used for creating the virtual environment. For example C(python3.5), C(python2.7). When not specified, the Python version used to run the ansible module is used. This parameter should not be used when C(virtualenv_command) is using C(pyvenv) or the C(-m venv) module.
//
// Default: <no value>
// Required: false
VirtualenvPython string `yaml:"virtualenv_python,omitempty" json:"virtualenv_python,omitempty" cty:"virtualenv_python"`
// VirtualenvSitePackages
// Whether the virtual environment will inherit packages from the global site-packages directory. Note that if this setting is changed on an already existing virtual environment it will not have any effect, the environment must be deleted and newly created.
//
// Default: no
// Required: false
VirtualenvSitePackages bool `yaml:"virtualenv_site_packages,omitempty" json:"virtualenv_site_packages,omitempty" cty:"virtualenv_site_packages"`
// contains filtered or unexported fields
}
type PipResult ¶
type PipResult struct {
types.CommonReturn
Raw string
// Cmd
// pip command used by the module
Cmd string `yaml:"cmd,omitempty" json:"cmd,omitempty" cty:"cmd"`
// Name
// list of python modules targetted by pip
Name []string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Requirements
// Path to the requirements file
Requirements string `yaml:"requirements,omitempty" json:"requirements,omitempty" cty:"requirements"`
// Version
// Version of the package specified in 'name'
Version string `yaml:"version,omitempty" json:"version,omitempty" cty:"version"`
// Virtualenv
// Path to the virtualenv
Virtualenv string `yaml:"virtualenv,omitempty" json:"virtualenv,omitempty" cty:"virtualenv"`
// contains filtered or unexported fields
}
type Reboot ¶
type Reboot struct {
Params RebootParams
Result RebootResult
}
Reboot (reboot) - Reboot a machine
Reboot a machine, wait for it to go down, come back up, and respond to commands.
For Windows targets, use the M(ansible.windows.win_reboot) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/reboot.py
func (*Reboot) GetCommonResult ¶ added in v0.0.3
func (m *Reboot) GetCommonResult() types.CommonReturn
func (*Reboot) GetResultRaw ¶
type RebootParams ¶
type RebootParams struct {
// BootTimeCommand
// Command to run that returns a unique string indicating the last time the system was booted.
// Setting this to a command that has different output each time it is run will cause the task to fail.
//
// Default: cat /proc/sys/kernel/random/boot_id
// Required: false
BootTimeCommand string `yaml:"boot_time_command,omitempty" json:"boot_time_command,omitempty" cty:"boot_time_command"`
// ConnectTimeout
// Maximum seconds to wait for a successful connection to the managed hosts before trying again.
// If unspecified, the default setting for the underlying connection plugin is used.
//
// Default: <no value>
// Required: false
ConnectTimeout int `yaml:"connect_timeout,omitempty" json:"connect_timeout,omitempty" cty:"connect_timeout"`
// Msg
// Message to display to users before reboot.
//
// Default: Reboot initiated by Ansible
// Required: false
Msg string `yaml:"msg,omitempty" json:"msg,omitempty" cty:"msg"`
// PostRebootDelay
// Seconds to wait after the reboot command was successful before attempting to validate the system rebooted successfully.
// This is useful if you want wait for something to settle despite your connection already working.
//
// Default: 0
// Required: false
PostRebootDelay int `yaml:"post_reboot_delay,omitempty" json:"post_reboot_delay,omitempty" cty:"post_reboot_delay"`
// PreRebootDelay
// Seconds to wait before reboot. Passed as a parameter to the reboot command.
// On Linux, macOS and OpenBSD, this is converted to minutes and rounded down. If less than 60, it will be set to 0.
// On Solaris and FreeBSD, this will be seconds.
//
// Default: 0
// Required: false
PreRebootDelay int `yaml:"pre_reboot_delay,omitempty" json:"pre_reboot_delay,omitempty" cty:"pre_reboot_delay"`
// RebootCommand
// Command to run that reboots the system, including any parameters passed to the command.
// Can be an absolute path to the command or just the command name. If an absolute path to the command is not given, C(search_paths) on the target system will be searched to find the absolute path.
// This will cause C(pre_reboot_delay), C(post_reboot_delay), and C(msg) to be ignored.
//
// Default: [determined based on target OS]
// Required: false
RebootCommand string `yaml:"reboot_command,omitempty" json:"reboot_command,omitempty" cty:"reboot_command"`
// RebootTimeout
// Maximum seconds to wait for machine to reboot and respond to a test command.
// This timeout is evaluated separately for both reboot verification and test command success so the maximum execution time for the module is twice this amount.
//
// Default: 600
// Required: false
RebootTimeout int `yaml:"reboot_timeout,omitempty" json:"reboot_timeout,omitempty" cty:"reboot_timeout"`
// SearchPaths
// Paths to search on the remote machine for the C(shutdown) command.
// I(Only) these paths will be searched for the C(shutdown) command. C(PATH) is ignored in the remote node when searching for the C(shutdown) command.
//
// Default: [/sbin /bin /usr/sbin /usr/bin /usr/local/sbin]
// Required: false
SearchPaths []string `yaml:"search_paths,omitempty" json:"search_paths,omitempty" cty:"search_paths"`
// TestCommand
// Command to run on the rebooted host and expect success from to determine the machine is ready for further tasks.
//
// Default: whoami
// Required: false
TestCommand string `yaml:"test_command,omitempty" json:"test_command,omitempty" cty:"test_command"`
// contains filtered or unexported fields
}
func (*RebootParams) Get ¶ added in v0.0.6
func (p *RebootParams) Get(name string) (interface{}, error)
func (*RebootParams) Names ¶ added in v0.0.6
func (p *RebootParams) Names() []string
func (*RebootParams) Set ¶ added in v0.0.6
func (p *RebootParams) Set(name string, value interface{}) error
type RebootResult ¶
type RebootResult struct {
types.CommonReturn
Raw string
// Elapsed
// The number of seconds that elapsed waiting for the system to be rebooted.
Elapsed int `yaml:"elapsed,omitempty" json:"elapsed,omitempty" cty:"elapsed"`
// Rebooted
// true if the machine was rebooted
Rebooted bool `yaml:"rebooted,omitempty" json:"rebooted,omitempty" cty:"rebooted"`
// contains filtered or unexported fields
}
func (*RebootResult) Get ¶ added in v0.0.6
func (r *RebootResult) Get(name string) (interface{}, error)
func (*RebootResult) Names ¶ added in v0.0.6
func (r *RebootResult) Names() []string
func (*RebootResult) Set ¶ added in v0.0.6
func (r *RebootResult) Set(name string, value interface{}) error
type Replace ¶
type Replace struct {
Params ReplaceParams
Result ReplaceResult
}
Replace (replace) - Replace all instances of a particular string in a file using a back-referenced regular expression
This module will replace all instances of a pattern within a file.
It is up to the user to maintain idempotence by ensuring that the same pattern would never match any replacements made.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/replace.py
func NewReplace ¶
func NewReplace() *Replace
Replace (replace) - Replace all instances of a particular string in a file using a back-referenced regular expression
func (*Replace) GetCommonResult ¶ added in v0.0.3
func (m *Replace) GetCommonResult() types.CommonReturn
func (*Replace) GetResultRaw ¶
type ReplaceParams ¶
type ReplaceParams struct {
// After
// If specified, only content after this match will be replaced/removed.
// Can be used in combination with C(before).
// Uses Python regular expressions; see U(https://docs.python.org/3/library/re.html).
// Uses DOTALL, which means the C(.) special character I(can match newlines).
//
// Default: <no value>
// Required: false
After string `yaml:"after,omitempty" json:"after,omitempty" cty:"after"`
// Backup
// Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
//
// Default: no
// Required: false
Backup bool `yaml:"backup,omitempty" json:"backup,omitempty" cty:"backup"`
// Before
// If specified, only content before this match will be replaced/removed.
// Can be used in combination with C(after).
// Uses Python regular expressions; see U(https://docs.python.org/3/library/re.html).
// Uses DOTALL, which means the C(.) special character I(can match newlines).
//
// Default: <no value>
// Required: false
Before string `yaml:"before,omitempty" json:"before,omitempty" cty:"before"`
// Encoding
// The character encoding for reading and writing the file.
//
// Default: utf-8
// Required: false
Encoding string `yaml:"encoding,omitempty" json:"encoding,omitempty" cty:"encoding"`
// Others
// All arguments accepted by the M(ansible.builtin.file) module also work here.
//
// Default: <no value>
// Required: false
Others string `yaml:"others,omitempty" json:"others,omitempty" cty:"others"`
// Path
// The file to modify.
// Before Ansible 2.3 this option was only usable as I(dest), I(destfile) and I(name).
//
// Default: <no value>
// Required: true
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// Regexp
// The regular expression to look for in the contents of the file.
// Uses Python regular expressions; see U(https://docs.python.org/3/library/re.html).
// Uses MULTILINE mode, which means C(^) and C($) match the beginning and end of the file, as well as the beginning and end respectively of I(each line) of the file.
// Does not use DOTALL, which means the C(.) special character matches any character I(except newlines). A common mistake is to assume that a negated character set like C([^#]) will also not match newlines.
// In order to exclude newlines, they must be added to the set like C([^#\n]).
// Note that, as of Ansible 2.0, short form tasks should have any escape sequences backslash-escaped in order to prevent them being parsed as string literal escapes. See the examples.
//
// Default: <no value>
// Required: true
Regexp string `yaml:"regexp,omitempty" json:"regexp,omitempty" cty:"regexp"`
// Replace
// The string to replace regexp matches.
// May contain backreferences that will get expanded with the regexp capture groups if the regexp matches.
// If not set, matches are removed entirely.
// Backreferences can be used ambiguously like C(\1), or explicitly like C(\g<1>).
//
// Default: <no value>
// Required: false
Replace string `yaml:"replace,omitempty" json:"replace,omitempty" cty:"replace"`
// contains filtered or unexported fields
}
func (*ReplaceParams) Get ¶ added in v0.0.6
func (p *ReplaceParams) Get(name string) (interface{}, error)
func (*ReplaceParams) Names ¶ added in v0.0.6
func (p *ReplaceParams) Names() []string
func (*ReplaceParams) Set ¶ added in v0.0.6
func (p *ReplaceParams) Set(name string, value interface{}) error
type ReplaceResult ¶
type ReplaceResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*ReplaceResult) Get ¶ added in v0.0.6
func (r *ReplaceResult) Get(name string) (interface{}, error)
func (*ReplaceResult) Names ¶ added in v0.0.6
func (r *ReplaceResult) Names() []string
func (*ReplaceResult) Set ¶ added in v0.0.6
func (r *ReplaceResult) Set(name string, value interface{}) error
type RpmKey ¶
type RpmKey struct {
Params RpmKeyParams
Result RpmKeyResult
}
RpmKey (rpm_key) - Adds or removes a gpg key from the rpm db
Adds or removes (rpm --import) a gpg key to your rpm database.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/rpm_key.py
func NewRpmKey ¶
func NewRpmKey() *RpmKey
RpmKey (rpm_key) - Adds or removes a gpg key from the rpm db
func (*RpmKey) GetCommonResult ¶ added in v0.0.3
func (m *RpmKey) GetCommonResult() types.CommonReturn
func (*RpmKey) GetResultRaw ¶
type RpmKeyParams ¶
type RpmKeyParams struct {
// Fingerprint
// The long-form fingerprint of the key being imported.
// This will be used to verify the specified key.
//
// Default: <no value>
// Required: false
Fingerprint string `yaml:"fingerprint,omitempty" json:"fingerprint,omitempty" cty:"fingerprint"`
// Key
// Key that will be modified. Can be a url, a file on the managed node, or a keyid if the key already exists in the database.
//
// Default: <no value>
// Required: true
Key string `yaml:"key,omitempty" json:"key,omitempty" cty:"key"`
// State
// If the key will be imported or removed from the rpm db.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// ValidateCerts
// If C(no) and the C(key) is a url starting with https, SSL certificates will not be validated.
// This should only be used on personally controlled sites using self-signed certificates.
//
// Default: yes
// Required: false
ValidateCerts bool `yaml:"validate_certs,omitempty" json:"validate_certs,omitempty" cty:"validate_certs"`
// contains filtered or unexported fields
}
func (*RpmKeyParams) Get ¶ added in v0.0.6
func (p *RpmKeyParams) Get(name string) (interface{}, error)
func (*RpmKeyParams) Names ¶ added in v0.0.6
func (p *RpmKeyParams) Names() []string
func (*RpmKeyParams) Set ¶ added in v0.0.6
func (p *RpmKeyParams) Set(name string, value interface{}) error
type RpmKeyResult ¶
type RpmKeyResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*RpmKeyResult) Get ¶ added in v0.0.6
func (r *RpmKeyResult) Get(name string) (interface{}, error)
func (*RpmKeyResult) Names ¶ added in v0.0.6
func (r *RpmKeyResult) Names() []string
func (*RpmKeyResult) Set ¶ added in v0.0.6
func (r *RpmKeyResult) Set(name string, value interface{}) error
type Setup ¶
type Setup struct {
Params SetupParams
Result SetupResult
}
Setup (setup) - Gathers facts about remote hosts
This module is automatically called by playbooks to gather useful variables about remote hosts that can be used in playbooks. It can also be executed directly by C(/usr/bin/ansible) to check what variables are available to a host. Ansible provides many I(facts) about the system, automatically.
This module is also supported for Windows targets.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/setup.py
func (*Setup) GetCommonResult ¶ added in v0.0.3
func (m *Setup) GetCommonResult() types.CommonReturn
func (*Setup) GetResultRaw ¶
type SetupParams ¶
type SetupParams struct {
// FactPath
// Path used for local ansible facts (C(*.fact)) - files in this dir will be run (if executable) and their results be added to C(ansible_local) facts. If a file is not executable it is read instead. File/results format can be JSON or INI-format. The default C(fact_path) can be specified in C(ansible.cfg) for when setup is automatically called as part of C(gather_facts). NOTE - For windows clients, the results will be added to a variable named after the local file (without extension suffix), rather than C(ansible_local).
// Since Ansible 2.1, Windows hosts can use C(fact_path). Make sure that this path exists on the target host. Files in this path MUST be PowerShell scripts C(.ps1) which outputs an object. This object will be formatted by Ansible as json so the script should be outputting a raw hashtable, array, or other primitive object.
//
// Default: /etc/ansible/facts.d
// Required: false
FactPath string `yaml:"fact_path,omitempty" json:"fact_path,omitempty" cty:"fact_path"`
// Filter
// If supplied, only return facts that match one of the shell-style (fnmatch) pattern. An empty list basically means 'no filter'. As of Ansible 2.11, the type has changed from string to list and the default has became an empty list. A simple string is still accepted and works as a single pattern. The behaviour prior to Ansible 2.11 remains.
//
// Default: []
// Required: false
Filter []string `yaml:"filter,omitempty" json:"filter,omitempty" cty:"filter"`
// GatherSubset
// If supplied, restrict the additional facts collected to the given subset. Possible values: C(all), C(min), C(hardware), C(network), C(virtual), C(ohai), and C(facter). Can specify a list of values to specify a larger subset. Values can also be used with an initial C(!) to specify that that specific subset should not be collected. For instance: C(!hardware,!network,!virtual,!ohai,!facter). If C(!all) is specified then only the min subset is collected. To avoid collecting even the min subset, specify C(!all,!min). To collect only specific facts, use C(!all,!min), and specify the particular fact subsets. Use the filter parameter if you do not want to display some collected facts.
//
// Default: all
// Required: false
GatherSubset []string `yaml:"gather_subset,omitempty" json:"gather_subset,omitempty" cty:"gather_subset"`
// GatherTimeout
// Set the default timeout in seconds for individual fact gathering.
//
// Default: 10
// Required: false
GatherTimeout int `yaml:"gather_timeout,omitempty" json:"gather_timeout,omitempty" cty:"gather_timeout"`
// contains filtered or unexported fields
}
func (*SetupParams) Get ¶ added in v0.0.6
func (p *SetupParams) Get(name string) (interface{}, error)
func (*SetupParams) Names ¶ added in v0.0.6
func (p *SetupParams) Names() []string
func (*SetupParams) Set ¶ added in v0.0.6
func (p *SetupParams) Set(name string, value interface{}) error
type SetupResult ¶
type SetupResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*SetupResult) Get ¶ added in v0.0.6
func (r *SetupResult) Get(name string) (interface{}, error)
func (*SetupResult) Names ¶ added in v0.0.6
func (r *SetupResult) Names() []string
func (*SetupResult) Set ¶ added in v0.0.6
func (r *SetupResult) Set(name string, value interface{}) error
type Slurp ¶
type Slurp struct {
Params SlurpParams
Result SlurpResult
}
Slurp (slurp) - Slurps a file from remote nodes
This module works like M(ansible.builtin.fetch). It is used for fetching a base64- encoded blob containing the data in a remote file.
This module is also supported for Windows targets.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/slurp.py
func (*Slurp) GetCommonResult ¶ added in v0.0.3
func (m *Slurp) GetCommonResult() types.CommonReturn
func (*Slurp) GetResultRaw ¶
type SlurpParams ¶
type SlurpParams struct {
// Src
// The file on the remote system to fetch. This I(must) be a file, not a directory.
//
// Default: <no value>
// Required: true
Src string `yaml:"src,omitempty" json:"src,omitempty" cty:"src"`
// contains filtered or unexported fields
}
func (*SlurpParams) Get ¶ added in v0.0.6
func (p *SlurpParams) Get(name string) (interface{}, error)
func (*SlurpParams) Names ¶ added in v0.0.6
func (p *SlurpParams) Names() []string
func (*SlurpParams) Set ¶ added in v0.0.6
func (p *SlurpParams) Set(name string, value interface{}) error
type SlurpResult ¶
type SlurpResult struct {
types.CommonReturn
Raw string
// Content
// Encoded file content
Content string `yaml:"content,omitempty" json:"content,omitempty" cty:"content"`
// Encoding
// Type of encoding used for file
Encoding string `yaml:"encoding,omitempty" json:"encoding,omitempty" cty:"encoding"`
// Source
// Actual path of file slurped
Source string `yaml:"source,omitempty" json:"source,omitempty" cty:"source"`
// contains filtered or unexported fields
}
func (*SlurpResult) Get ¶ added in v0.0.6
func (r *SlurpResult) Get(name string) (interface{}, error)
func (*SlurpResult) Names ¶ added in v0.0.6
func (r *SlurpResult) Names() []string
func (*SlurpResult) Set ¶ added in v0.0.6
func (r *SlurpResult) Set(name string, value interface{}) error
type Stat ¶
type Stat struct {
Params StatParams
Result StatResult
}
Stat (stat) - Retrieve file or file system status
Retrieves facts for a file similar to the Linux/Unix 'stat' command.
For Windows targets, use the M(ansible.windows.win_stat) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/stat.py
func (*Stat) GetCommonResult ¶ added in v0.0.3
func (m *Stat) GetCommonResult() types.CommonReturn
func (*Stat) GetResultRaw ¶
type StatParams ¶
type StatParams struct {
// ChecksumAlgorithm
// Algorithm to determine checksum of file.
// Will throw an error if the host is unable to use specified algorithm.
// The remote host has to support the hashing method specified, C(md5) can be unavailable if the host is FIPS-140 compliant.
//
// Default: sha1
// Required: false
ChecksumAlgorithm string `yaml:"checksum_algorithm,omitempty" json:"checksum_algorithm,omitempty" cty:"checksum_algorithm"`
// Follow
// Whether to follow symlinks.
//
// Default: no
// Required: false
Follow bool `yaml:"follow,omitempty" json:"follow,omitempty" cty:"follow"`
// GetAttributes
// Get file attributes using lsattr tool if present.
//
// Default: yes
// Required: false
GetAttributes bool `yaml:"get_attributes,omitempty" json:"get_attributes,omitempty" cty:"get_attributes"`
// GetChecksum
// Whether to return a checksum of the file.
//
// Default: yes
// Required: false
GetChecksum bool `yaml:"get_checksum,omitempty" json:"get_checksum,omitempty" cty:"get_checksum"`
// GetMime
// Use file magic and return data about the nature of the file. this uses the 'file' utility found on most Linux/Unix systems.
// This will add both C(mime_type) and C(charset) fields to the return, if possible.
// In Ansible 2.3 this option changed from I(mime) to I(get_mime) and the default changed to C(yes).
//
// Default: yes
// Required: false
GetMime bool `yaml:"get_mime,omitempty" json:"get_mime,omitempty" cty:"get_mime"`
// Path
// The full path of the file/object to get the facts of.
//
// Default: <no value>
// Required: true
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// contains filtered or unexported fields
}
func (*StatParams) Get ¶ added in v0.0.6
func (p *StatParams) Get(name string) (interface{}, error)
func (*StatParams) Names ¶ added in v0.0.6
func (p *StatParams) Names() []string
func (*StatParams) Set ¶ added in v0.0.6
func (p *StatParams) Set(name string, value interface{}) error
type StatResult ¶
type StatResult struct {
types.CommonReturn
Raw string
// Stat
// Dictionary containing all the stat data, some platforms might add additional fields.
Stat interface{} `yaml:"stat,omitempty" json:"stat,omitempty" cty:"stat"`
// contains filtered or unexported fields
}
func (*StatResult) Get ¶ added in v0.0.6
func (r *StatResult) Get(name string) (interface{}, error)
func (*StatResult) Names ¶ added in v0.0.6
func (r *StatResult) Names() []string
func (*StatResult) Set ¶ added in v0.0.6
func (r *StatResult) Set(name string, value interface{}) error
type Subversion ¶
type Subversion struct {
Params SubversionParams
Result SubversionResult
}
Subversion (subversion) - Deploys a subversion repository
Deploy given repository URL / revision to dest. If dest exists, update to the specified revision, otherwise perform a checkout.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/subversion.py
func NewSubversion ¶
func NewSubversion() *Subversion
Subversion (subversion) - Deploys a subversion repository
func (*Subversion) GetCommonResult ¶ added in v0.0.3
func (m *Subversion) GetCommonResult() types.CommonReturn
func (*Subversion) GetParams ¶
func (m *Subversion) GetParams() types.Params
func (*Subversion) GetResult ¶
func (m *Subversion) GetResult() types.Result
func (*Subversion) GetResultRaw ¶
func (m *Subversion) GetResultRaw() string
func (*Subversion) GetType ¶
func (m *Subversion) GetType() string
type SubversionParams ¶
type SubversionParams struct {
// Checkout
// If C(no), do not check out the repository if it does not exist locally.
//
// Default: yes
// Required: false
Checkout bool `yaml:"checkout,omitempty" json:"checkout,omitempty" cty:"checkout"`
// Dest
// Absolute path where the repository should be deployed.
// The destination directory must be specified unless I(checkout=no), I(update=no), and I(export=no).
//
// Default: <no value>
// Required: false
Dest string `yaml:"dest,omitempty" json:"dest,omitempty" cty:"dest"`
// Executable
// Path to svn executable to use. If not supplied, the normal mechanism for resolving binary paths will be used.
//
// Default: <no value>
// Required: false
Executable string `yaml:"executable,omitempty" json:"executable,omitempty" cty:"executable"`
// Export
// If C(yes), do export instead of checkout/update.
//
// Default: no
// Required: false
Export bool `yaml:"export,omitempty" json:"export,omitempty" cty:"export"`
// Force
// If C(yes), modified files will be discarded. If C(no), module will fail if it encounters modified files. Prior to 1.9 the default was C(yes).
//
// Default: no
// Required: false
Force bool `yaml:"force,omitempty" json:"force,omitempty" cty:"force"`
// InPlace
// If the directory exists, then the working copy will be checked-out over-the-top using svn checkout --force; if force is specified then existing files with different content are reverted.
//
// Default: no
// Required: false
InPlace bool `yaml:"in_place,omitempty" json:"in_place,omitempty" cty:"in_place"`
// Password
// C(--password) parameter passed to svn when svn is less than version 1.10.0. This is not secure and the password will be leaked to argv.
// C(--password-from-stdin) parameter when svn is greater or equal to version 1.10.0.
//
// Default: <no value>
// Required: false
Password string `yaml:"password,omitempty" json:"password,omitempty" cty:"password"`
// Repo
// The subversion URL to the repository.
//
// Default: <no value>
// Required: true
Repo string `yaml:"repo,omitempty" json:"repo,omitempty" cty:"repo"`
// Revision
// Specific revision to checkout.
//
// Default: HEAD
// Required: false
Revision string `yaml:"revision,omitempty" json:"revision,omitempty" cty:"revision"`
// Switch
// If C(no), do not call svn switch before update.
//
// Default: yes
// Required: false
Switch bool `yaml:"switch,omitempty" json:"switch,omitempty" cty:"switch"`
// Update
// If C(no), do not retrieve new revisions from the origin repository.
//
// Default: yes
// Required: false
Update bool `yaml:"update,omitempty" json:"update,omitempty" cty:"update"`
// Username
// C(--username) parameter passed to svn.
//
// Default: <no value>
// Required: false
Username string `yaml:"username,omitempty" json:"username,omitempty" cty:"username"`
// ValidateCerts
// If C(no), passes the C(--trust-server-cert) flag to svn.
// If C(yes), does not pass the flag.
//
// Default: no
// Required: false
ValidateCerts bool `yaml:"validate_certs,omitempty" json:"validate_certs,omitempty" cty:"validate_certs"`
// contains filtered or unexported fields
}
func (*SubversionParams) Get ¶ added in v0.0.6
func (p *SubversionParams) Get(name string) (interface{}, error)
func (*SubversionParams) Names ¶ added in v0.0.6
func (p *SubversionParams) Names() []string
func (*SubversionParams) Set ¶ added in v0.0.6
func (p *SubversionParams) Set(name string, value interface{}) error
type SubversionResult ¶
type SubversionResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*SubversionResult) Get ¶ added in v0.0.6
func (r *SubversionResult) Get(name string) (interface{}, error)
func (*SubversionResult) Names ¶ added in v0.0.6
func (r *SubversionResult) Names() []string
func (*SubversionResult) Set ¶ added in v0.0.6
func (r *SubversionResult) Set(name string, value interface{}) error
type Systemd ¶
type Systemd struct {
Params SystemdParams
Result SystemdResult
}
Systemd (systemd) - Manage systemd units
Controls systemd units (services, timers, and so on) on remote hosts.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/systemd.py
func (*Systemd) GetCommonResult ¶ added in v0.0.3
func (m *Systemd) GetCommonResult() types.CommonReturn
func (*Systemd) GetResultRaw ¶
type SystemdParams ¶
type SystemdParams struct {
// DaemonReexec
// Run daemon_reexec command before doing any other operations, the systemd manager will serialize the manager state.
//
// Default: no
// Required: false
DaemonReexec bool `yaml:"daemon_reexec,omitempty" json:"daemon_reexec,omitempty" cty:"daemon_reexec"`
// DaemonReload
// Run daemon-reload before doing any other operations, to make sure systemd has read any changes.
// When set to C(true), runs daemon-reload even if the module does not start or stop anything.
//
// Default: no
// Required: false
DaemonReload bool `yaml:"daemon_reload,omitempty" json:"daemon_reload,omitempty" cty:"daemon_reload"`
// Enabled
// Whether the unit should start on boot. B(At least one of state and enabled are required.)
//
// Default: <no value>
// Required: false
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty" cty:"enabled"`
// Force
// Whether to override existing symlinks.
//
// Default: <no value>
// Required: false
Force bool `yaml:"force,omitempty" json:"force,omitempty" cty:"force"`
// Masked
// Whether the unit should be masked or not, a masked unit is impossible to start.
//
// Default: <no value>
// Required: false
Masked bool `yaml:"masked,omitempty" json:"masked,omitempty" cty:"masked"`
// Name
// Name of the unit. This parameter takes the name of exactly one unit to work with.
// When no extension is given, it is implied to a C(.service) as systemd.
// When using in a chroot environment you always need to specify the name of the unit with the extension. For example, C(crond.service).
//
// Default: <no value>
// Required: false
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// NoBlock
// Do not synchronously wait for the requested operation to finish. Enqueued job will continue without Ansible blocking on its completion.
//
// Default: no
// Required: false
NoBlock bool `yaml:"no_block,omitempty" json:"no_block,omitempty" cty:"no_block"`
// Scope
// Run systemctl within a given service manager scope, either as the default system scope C(system), the current user's scope C(user), or the scope of all users C(global).
// For systemd to work with 'user', the executing user must have its own instance of dbus started and accessible (systemd requirement).
// The user dbus process is normally started during normal login, but not during the run of Ansible tasks. Otherwise you will probably get a 'Failed to connect to bus: no such file or directory' error.
// The user must have access, normally given via setting the C(XDG_RUNTIME_DIR) variable, see example below.
//
// Default: system
// Required: false
Scope string `yaml:"scope,omitempty" json:"scope,omitempty" cty:"scope"`
// State
// C(started)/C(stopped) are idempotent actions that will not run commands unless necessary. C(restarted) will always bounce the unit. C(reloaded) will always reload.
//
// Default: <no value>
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// contains filtered or unexported fields
}
func (*SystemdParams) Get ¶ added in v0.0.6
func (p *SystemdParams) Get(name string) (interface{}, error)
func (*SystemdParams) Names ¶ added in v0.0.6
func (p *SystemdParams) Names() []string
func (*SystemdParams) Set ¶ added in v0.0.6
func (p *SystemdParams) Set(name string, value interface{}) error
type SystemdResult ¶
type SystemdResult struct {
types.CommonReturn
Raw string
// Status
// A dictionary with the key=value pairs returned from C(systemctl show).
Status interface{} `yaml:"status,omitempty" json:"status,omitempty" cty:"status"`
// contains filtered or unexported fields
}
func (*SystemdResult) Get ¶ added in v0.0.6
func (r *SystemdResult) Get(name string) (interface{}, error)
func (*SystemdResult) Names ¶ added in v0.0.6
func (r *SystemdResult) Names() []string
func (*SystemdResult) Set ¶ added in v0.0.6
func (r *SystemdResult) Set(name string, value interface{}) error
type Sysvinit ¶
type Sysvinit struct {
Params SysvinitParams
Result SysvinitResult
}
Sysvinit (sysvinit) - Manage SysV services.
Controls services on target hosts that use the SysV init system.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/sysvinit.py
func (*Sysvinit) GetCommonResult ¶ added in v0.0.3
func (m *Sysvinit) GetCommonResult() types.CommonReturn
func (*Sysvinit) GetResultRaw ¶
type SysvinitParams ¶
type SysvinitParams struct {
// Arguments
// Additional arguments provided on the command line that some init scripts accept.
//
// Default: <no value>
// Required: false
Arguments string `yaml:"arguments,omitempty" json:"arguments,omitempty" cty:"arguments"`
// Daemonize
// Have the module daemonize as the service itself might not do so properly.
// This is useful with badly written init scripts or daemons, which commonly manifests as the task hanging as it is still holding the tty or the service dying when the task is over as the connection closes the session.
//
// Default: no
// Required: false
Daemonize bool `yaml:"daemonize,omitempty" json:"daemonize,omitempty" cty:"daemonize"`
// Enabled
// Whether the service should start on boot. B(At least one of state and enabled are required.)
//
// Default: <no value>
// Required: false
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty" cty:"enabled"`
// Name
// Name of the service.
//
// Default: <no value>
// Required: true
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Pattern
// A substring to look for as would be found in the output of the I(ps) command as a stand-in for a status result.
// If the string is found, the service will be assumed to be running.
// This option is mainly for use with init scripts that don't support the 'status' option.
//
// Default: <no value>
// Required: false
Pattern string `yaml:"pattern,omitempty" json:"pattern,omitempty" cty:"pattern"`
// Runlevels
// The runlevels this script should be enabled/disabled from.
// Use this to override the defaults set by the package or init script itself.
//
// Default: <no value>
// Required: false
Runlevels []string `yaml:"runlevels,omitempty" json:"runlevels,omitempty" cty:"runlevels"`
// Sleep
// If the service is being C(restarted) or C(reloaded) then sleep this many seconds between the stop and start command. This helps to workaround badly behaving services.
//
// Default: 1
// Required: false
Sleep int `yaml:"sleep,omitempty" json:"sleep,omitempty" cty:"sleep"`
// State
// C(started)/C(stopped) are idempotent actions that will not run commands unless necessary. Not all init scripts support C(restarted) nor C(reloaded) natively, so these will both trigger a stop and start as needed.
//
// Default: <no value>
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// contains filtered or unexported fields
}
func (*SysvinitParams) Get ¶ added in v0.0.6
func (p *SysvinitParams) Get(name string) (interface{}, error)
func (*SysvinitParams) Names ¶ added in v0.0.6
func (p *SysvinitParams) Names() []string
func (*SysvinitParams) Set ¶ added in v0.0.6
func (p *SysvinitParams) Set(name string, value interface{}) error
type SysvinitResult ¶
type SysvinitResult struct {
types.CommonReturn
Raw string
// Results
// results from actions taken
Results interface{} `yaml:"results,omitempty" json:"results,omitempty" cty:"results"`
// contains filtered or unexported fields
}
func (*SysvinitResult) Get ¶ added in v0.0.6
func (r *SysvinitResult) Get(name string) (interface{}, error)
func (*SysvinitResult) Names ¶ added in v0.0.6
func (r *SysvinitResult) Names() []string
func (*SysvinitResult) Set ¶ added in v0.0.6
func (r *SysvinitResult) Set(name string, value interface{}) error
type Tempfile ¶
type Tempfile struct {
Params TempfileParams
Result TempfileResult
}
Tempfile (tempfile) - Creates temporary files and directories
The C(tempfile) module creates temporary files and directories. C(mktemp) command takes different parameters on various systems, this module helps to avoid troubles related to that. Files/directories created by module are accessible only by creator. In case you need to make them world-accessible you need to use M(ansible.builtin.file) module.
For Windows targets, use the M(ansible.windows.win_tempfile) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/tempfile.py
func NewTempfile ¶
func NewTempfile() *Tempfile
Tempfile (tempfile) - Creates temporary files and directories
func (*Tempfile) GetCommonResult ¶ added in v0.0.3
func (m *Tempfile) GetCommonResult() types.CommonReturn
func (*Tempfile) GetResultRaw ¶
type TempfileParams ¶
type TempfileParams struct {
// Path
// Location where temporary file or directory should be created.
// If path is not specified, the default system temporary directory will be used.
//
// Default: <no value>
// Required: false
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// Prefix
// Prefix of file/directory name created by module.
//
// Default: ansible.
// Required: false
Prefix string `yaml:"prefix,omitempty" json:"prefix,omitempty" cty:"prefix"`
// State
// Whether to create file or directory.
//
// Default: file
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// Suffix
// Suffix of file/directory name created by module.
//
// Default:
// Required: false
Suffix string `yaml:"suffix,omitempty" json:"suffix,omitempty" cty:"suffix"`
// contains filtered or unexported fields
}
func (*TempfileParams) Get ¶ added in v0.0.6
func (p *TempfileParams) Get(name string) (interface{}, error)
func (*TempfileParams) Names ¶ added in v0.0.6
func (p *TempfileParams) Names() []string
func (*TempfileParams) Set ¶ added in v0.0.6
func (p *TempfileParams) Set(name string, value interface{}) error
type TempfileResult ¶
type TempfileResult struct {
types.CommonReturn
Raw string
// Path
// Path to created file or directory.
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// contains filtered or unexported fields
}
func (*TempfileResult) Get ¶ added in v0.0.6
func (r *TempfileResult) Get(name string) (interface{}, error)
func (*TempfileResult) Names ¶ added in v0.0.6
func (r *TempfileResult) Names() []string
func (*TempfileResult) Set ¶ added in v0.0.6
func (r *TempfileResult) Set(name string, value interface{}) error
type Template ¶
type Template struct {
Params TemplateParams
Result TemplateResult
}
Template (template) - Template a file out to a target host
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/template.py
func NewTemplate ¶
func NewTemplate() *Template
Template (template) - Template a file out to a target host
func (*Template) GetCommonResult ¶ added in v0.0.3
func (m *Template) GetCommonResult() types.CommonReturn
func (*Template) GetResultRaw ¶
type TemplateParams ¶
type TemplateParams struct {
// Follow
// Determine whether symbolic links should be followed.
// When set to C(yes) symbolic links will be followed, if they exist.
// When set to C(no) symbolic links will not be followed.
// Previous to Ansible 2.4, this was hardcoded as C(yes).
//
// Default: no
// Required: false
Follow bool `yaml:"follow,omitempty" json:"follow,omitempty" cty:"follow"`
// contains filtered or unexported fields
}
func (*TemplateParams) Get ¶ added in v0.0.6
func (p *TemplateParams) Get(name string) (interface{}, error)
func (*TemplateParams) Names ¶ added in v0.0.6
func (p *TemplateParams) Names() []string
func (*TemplateParams) Set ¶ added in v0.0.6
func (p *TemplateParams) Set(name string, value interface{}) error
type TemplateResult ¶
type TemplateResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
func (*TemplateResult) Get ¶ added in v0.0.6
func (r *TemplateResult) Get(name string) (interface{}, error)
func (*TemplateResult) Names ¶ added in v0.0.6
func (r *TemplateResult) Names() []string
func (*TemplateResult) Set ¶ added in v0.0.6
func (r *TemplateResult) Set(name string, value interface{}) error
type Unarchive ¶
type Unarchive struct {
Params UnarchiveParams
Result UnarchiveResult
}
Unarchive (unarchive) - Unpacks an archive after (optionally) copying it from the local machine
The C(unarchive) module unpacks an archive. It will not unpack a compressed file that does not contain an archive.
By default, it will copy the source file from the local system to the target before unpacking.
Set C(remote_src=yes) to unpack an archive which already exists on the target.
If checksum validation is desired, use M(ansible.builtin.get_url) or M(ansible.builtin.uri) instead to fetch the file and set C(remote_src=yes).
For Windows targets, use the M(community.windows.win_unzip) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/unarchive.py
func NewUnarchive ¶
func NewUnarchive() *Unarchive
Unarchive (unarchive) - Unpacks an archive after (optionally) copying it from the local machine
func (*Unarchive) GetCommonResult ¶ added in v0.0.3
func (m *Unarchive) GetCommonResult() types.CommonReturn
func (*Unarchive) GetResultRaw ¶
type UnarchiveParams ¶
type UnarchiveParams struct {
// Copy
// If true, the file is copied from local controller to the managed (remote) node, otherwise, the plugin will look for src archive on the managed machine.
// This option has been deprecated in favor of C(remote_src).
// This option is mutually exclusive with C(remote_src).
//
// Default: yes
// Required: false
Copy bool `yaml:"copy,omitempty" json:"copy,omitempty" cty:"copy"`
// Creates
// If the specified absolute path (file or directory) already exists, this step will B(not) be run.
//
// Default: <no value>
// Required: false
Creates string `yaml:"creates,omitempty" json:"creates,omitempty" cty:"creates"`
// Dest
// Remote absolute path where the archive should be unpacked.
//
// Default: <no value>
// Required: true
Dest string `yaml:"dest,omitempty" json:"dest,omitempty" cty:"dest"`
// Exclude
// List the directory and file entries that you would like to exclude from the unarchive action.
// Mutually exclusive with C(include).
//
// Default: []
// Required: false
Exclude []string `yaml:"exclude,omitempty" json:"exclude,omitempty" cty:"exclude"`
// ExtraOpts
// Specify additional options by passing in an array.
// Each space-separated command-line option should be a new element of the array. See examples.
// Command-line options with multiple elements must use multiple lines in the array, one for each element.
//
// Default:
// Required: false
ExtraOpts []string `yaml:"extra_opts,omitempty" json:"extra_opts,omitempty" cty:"extra_opts"`
// Include
// List of directory and file entries that you would like to extract from the archive. If C(include) is not empty, only files listed here will be extracted.
// Mutually exclusive with C(exclude).
//
// Default: []
// Required: false
Include []string `yaml:"include,omitempty" json:"include,omitempty" cty:"include"`
// IoBufferSize
// Size of the volatile memory buffer that is used for extracting files from the archive in bytes.
//
// Default: 65536
// Required: false
IoBufferSize int `yaml:"io_buffer_size,omitempty" json:"io_buffer_size,omitempty" cty:"io_buffer_size"`
// KeepNewer
// Do not replace existing files that are newer than files from the archive.
//
// Default: no
// Required: false
KeepNewer bool `yaml:"keep_newer,omitempty" json:"keep_newer,omitempty" cty:"keep_newer"`
// ListFiles
// If set to True, return the list of files that are contained in the tarball.
//
// Default: no
// Required: false
ListFiles bool `yaml:"list_files,omitempty" json:"list_files,omitempty" cty:"list_files"`
// RemoteSrc
// Set to C(yes) to indicate the archived file is already on the remote system and not local to the Ansible controller.
// This option is mutually exclusive with C(copy).
//
// Default: no
// Required: false
RemoteSrc bool `yaml:"remote_src,omitempty" json:"remote_src,omitempty" cty:"remote_src"`
// Src
// If C(remote_src=no) (default), local path to archive file to copy to the target server; can be absolute or relative. If C(remote_src=yes), path on the target server to existing archive file to unpack.
// If C(remote_src=yes) and C(src) contains C(://), the remote machine will download the file from the URL first. (version_added 2.0). This is only for simple cases, for full download support use the M(ansible.builtin.get_url) module.
//
// Default: <no value>
// Required: true
Src string `yaml:"src,omitempty" json:"src,omitempty" cty:"src"`
// ValidateCerts
// This only applies if using a https URL as the source of the file.
// This should only set to C(no) used on personally controlled sites using self-signed certificate.
// Prior to 2.2 the code worked as if this was set to C(yes).
//
// Default: yes
// Required: false
ValidateCerts bool `yaml:"validate_certs,omitempty" json:"validate_certs,omitempty" cty:"validate_certs"`
// contains filtered or unexported fields
}
func (*UnarchiveParams) Get ¶ added in v0.0.6
func (p *UnarchiveParams) Get(name string) (interface{}, error)
func (*UnarchiveParams) Names ¶ added in v0.0.6
func (p *UnarchiveParams) Names() []string
func (*UnarchiveParams) Set ¶ added in v0.0.6
func (p *UnarchiveParams) Set(name string, value interface{}) error
type UnarchiveResult ¶
type UnarchiveResult struct {
types.CommonReturn
Raw string
// Dest
// Path to the destination directory.
Dest string `yaml:"dest,omitempty" json:"dest,omitempty" cty:"dest"`
// Files
// List of all the files in the archive.
Files []string `yaml:"files,omitempty" json:"files,omitempty" cty:"files"`
// Gid
// Numerical ID of the group that owns the destination directory.
Gid int `yaml:"gid,omitempty" json:"gid,omitempty" cty:"gid"`
// Group
// Name of the group that owns the destination directory.
Group string `yaml:"group,omitempty" json:"group,omitempty" cty:"group"`
// Handler
// Archive software handler used to extract and decompress the archive.
Handler string `yaml:"handler,omitempty" json:"handler,omitempty" cty:"handler"`
// Mode
// String that represents the octal permissions of the destination directory.
Mode string `yaml:"mode,omitempty" json:"mode,omitempty" cty:"mode"`
// Owner
// Name of the user that owns the destination directory.
Owner string `yaml:"owner,omitempty" json:"owner,omitempty" cty:"owner"`
// Size
// The size of destination directory in bytes. Does not include the size of files or subdirectories contained within.
Size int `yaml:"size,omitempty" json:"size,omitempty" cty:"size"`
// Src
Src string `yaml:"src,omitempty" json:"src,omitempty" cty:"src"`
// State
// State of the destination. Effectively always "directory".
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// Uid
// Numerical ID of the user that owns the destination directory.
Uid int `yaml:"uid,omitempty" json:"uid,omitempty" cty:"uid"`
// contains filtered or unexported fields
}
func (*UnarchiveResult) Get ¶ added in v0.0.6
func (r *UnarchiveResult) Get(name string) (interface{}, error)
func (*UnarchiveResult) Names ¶ added in v0.0.6
func (r *UnarchiveResult) Names() []string
func (*UnarchiveResult) Set ¶ added in v0.0.6
func (r *UnarchiveResult) Set(name string, value interface{}) error
type Uri ¶
Uri (uri) - Interacts with webservices
Interacts with HTTP and HTTPS web services and supports Digest, Basic and WSSE HTTP authentication mechanisms.
For Windows targets, use the M(ansible.windows.win_uri) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/uri.py
func (*Uri) GetCommonResult ¶ added in v0.0.3
func (m *Uri) GetCommonResult() types.CommonReturn
func (*Uri) GetResultRaw ¶
type UriParams ¶
type UriParams struct {
// Body
// The body of the http request/response to the web service. If C(body_format) is set to 'json' it will take an already formatted JSON string or convert a data structure into JSON.
// If C(body_format) is set to 'form-urlencoded' it will convert a dictionary or list of tuples into an 'application/x-www-form-urlencoded' string. (Added in v2.7)
// If C(body_format) is set to 'form-multipart' it will convert a dictionary into 'multipart/form-multipart' body. (Added in v2.10)
//
// Default: <no value>
// Required: false
Body string `yaml:"body,omitempty" json:"body,omitempty" cty:"body"`
// BodyFormat
// The serialization format of the body. When set to C(json), C(form-multipart), or C(form-urlencoded), encodes the body argument, if needed, and automatically sets the Content-Type header accordingly.
// As of v2.3 it is possible to override the C(Content-Type) header, when set to C(json) or C(form-urlencoded) via the I(headers) option.
// The 'Content-Type' header cannot be overridden when using C(form-multipart)
// C(form-urlencoded) was added in v2.7.
// C(form-multipart) was added in v2.10.
//
// Default: raw
// Required: false
BodyFormat string `yaml:"body_format,omitempty" json:"body_format,omitempty" cty:"body_format"`
// CaPath
// PEM formatted file that contains a CA certificate to be used for validation
//
// Default: <no value>
// Required: false
CaPath string `yaml:"ca_path,omitempty" json:"ca_path,omitempty" cty:"ca_path"`
// ClientCert
// PEM formatted certificate chain file to be used for SSL client authentication.
// This file can also include the key as well, and if the key is included, I(client_key) is not required
//
// Default: <no value>
// Required: false
ClientCert string `yaml:"client_cert,omitempty" json:"client_cert,omitempty" cty:"client_cert"`
// ClientKey
// PEM formatted file that contains your private key to be used for SSL client authentication.
// If I(client_cert) contains both the certificate and key, this option is not required.
//
// Default: <no value>
// Required: false
ClientKey string `yaml:"client_key,omitempty" json:"client_key,omitempty" cty:"client_key"`
// Creates
// A filename, when it already exists, this step will not be run.
//
// Default: <no value>
// Required: false
Creates string `yaml:"creates,omitempty" json:"creates,omitempty" cty:"creates"`
// Dest
// A path of where to download the file to (if desired). If I(dest) is a directory, the basename of the file on the remote server will be used.
//
// Default: <no value>
// Required: false
Dest string `yaml:"dest,omitempty" json:"dest,omitempty" cty:"dest"`
// FollowRedirects
// Whether or not the URI module should follow redirects. C(all) will follow all redirects. C(safe) will follow only "safe" redirects, where "safe" means that the client is only doing a GET or HEAD on the URI to which it is being redirected. C(none) will not follow any redirects. Note that C(yes) and C(no) choices are accepted for backwards compatibility, where C(yes) is the equivalent of C(all) and C(no) is the equivalent of C(safe). C(yes) and C(no) are deprecated and will be removed in some future version of Ansible.
//
// Default: safe
// Required: false
FollowRedirects string `yaml:"follow_redirects,omitempty" json:"follow_redirects,omitempty" cty:"follow_redirects"`
// Force
// If C(yes) do not get a cached copy.
//
// Default: no
// Required: false
Force bool `yaml:"force,omitempty" json:"force,omitempty" cty:"force"`
// ForceBasicAuth
// Force the sending of the Basic authentication header upon initial request.
// The library used by the uri module only sends authentication information when a webservice responds to an initial request with a 401 status. Since some basic auth services do not properly send a 401, logins will fail.
//
// Default: no
// Required: false
ForceBasicAuth bool `yaml:"force_basic_auth,omitempty" json:"force_basic_auth,omitempty" cty:"force_basic_auth"`
// Headers
// Add custom HTTP headers to a request in the format of a YAML hash. As of C(2.3) supplying C(Content-Type) here will override the header generated by supplying C(json) or C(form-urlencoded) for I(body_format).
//
// Default: <no value>
// Required: false
Headers map[string]string `yaml:"headers,omitempty" json:"headers,omitempty" cty:"headers"`
// HttpAgent
// Header to identify as, generally appears in web server logs.
//
// Default: ansible-httpget
// Required: false
HttpAgent string `yaml:"http_agent,omitempty" json:"http_agent,omitempty" cty:"http_agent"`
// Method
// The HTTP method of the request or response.
// In more recent versions we do not restrict the method at the module level anymore but it still must be a valid method accepted by the service handling the request.
//
// Default: GET
// Required: false
Method string `yaml:"method,omitempty" json:"method,omitempty" cty:"method"`
// RemoteSrc
// If C(no), the module will search for the C(src) on the controller node.
// If C(yes), the module will search for the C(src) on the managed (remote) node.
//
// Default: no
// Required: false
RemoteSrc bool `yaml:"remote_src,omitempty" json:"remote_src,omitempty" cty:"remote_src"`
// Removes
// A filename, when it does not exist, this step will not be run.
//
// Default: <no value>
// Required: false
Removes string `yaml:"removes,omitempty" json:"removes,omitempty" cty:"removes"`
// ReturnContent
// Whether or not to return the body of the response as a "content" key in the dictionary result no matter it succeeded or failed.
// Independently of this option, if the reported Content-type is "application/json", then the JSON is always loaded into a key called C(json) in the dictionary results.
//
// Default: no
// Required: false
ReturnContent bool `yaml:"return_content,omitempty" json:"return_content,omitempty" cty:"return_content"`
// Src
// Path to file to be submitted to the remote server.
// Cannot be used with I(body).
//
// Default: <no value>
// Required: false
Src string `yaml:"src,omitempty" json:"src,omitempty" cty:"src"`
// StatusCode
// A list of valid, numeric, HTTP status codes that signifies success of the request.
//
// Default: [200]
// Required: false
StatusCode []int `yaml:"status_code,omitempty" json:"status_code,omitempty" cty:"status_code"`
// Timeout
// The socket level timeout in seconds
//
// Default: 30
// Required: false
Timeout int `yaml:"timeout,omitempty" json:"timeout,omitempty" cty:"timeout"`
// UnixSocket
// Path to Unix domain socket to use for connection
//
// Default: <no value>
// Required: false
UnixSocket string `yaml:"unix_socket,omitempty" json:"unix_socket,omitempty" cty:"unix_socket"`
// UnredirectedHeaders
// A list of header names that will not be sent on subsequent redirected requests. This list is case insensitive. By default all headers will be redirected. In some cases it may be beneficial to list headers such as C(Authorization) here to avoid potential credential exposure.
//
// Default: []
// Required: false
UnredirectedHeaders []string `yaml:"unredirected_headers,omitempty" json:"unredirected_headers,omitempty" cty:"unredirected_headers"`
// Url
// HTTP or HTTPS URL in the form (http|https)://host.domain[:port]/path
//
// Default: <no value>
// Required: true
Url string `yaml:"url,omitempty" json:"url,omitempty" cty:"url"`
// UrlPassword
// A password for the module to use for Digest, Basic or WSSE authentication.
//
// Default: <no value>
// Required: false
UrlPassword string `yaml:"url_password,omitempty" json:"url_password,omitempty" cty:"url_password"`
// UrlUsername
// A username for the module to use for Digest, Basic or WSSE authentication.
//
// Default: <no value>
// Required: false
UrlUsername string `yaml:"url_username,omitempty" json:"url_username,omitempty" cty:"url_username"`
// UseGssapi
// Use GSSAPI to perform the authentication, typically this is for Kerberos or Kerberos through Negotiate authentication.
// Requires the Python library L(gssapi,https://github.com/pythongssapi/python-gssapi) to be installed.
// Credentials for GSSAPI can be specified with I(url_username)/I(url_password) or with the GSSAPI env var C(KRB5CCNAME) that specified a custom Kerberos credential cache.
// NTLM authentication is C(not) supported even if the GSSAPI mech for NTLM has been installed.
//
// Default: no
// Required: false
UseGssapi bool `yaml:"use_gssapi,omitempty" json:"use_gssapi,omitempty" cty:"use_gssapi"`
// UseProxy
// If C(no), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
//
// Default: yes
// Required: false
UseProxy bool `yaml:"use_proxy,omitempty" json:"use_proxy,omitempty" cty:"use_proxy"`
// ValidateCerts
// If C(no), SSL certificates will not be validated.
// This should only set to C(no) used on personally controlled sites using self-signed certificates.
// Prior to 1.9.2 the code defaulted to C(no).
//
// Default: yes
// Required: false
ValidateCerts bool `yaml:"validate_certs,omitempty" json:"validate_certs,omitempty" cty:"validate_certs"`
// contains filtered or unexported fields
}
type UriResult ¶
type UriResult struct {
types.CommonReturn
Raw string
// Content
// The response body content.
Content string `yaml:"content,omitempty" json:"content,omitempty" cty:"content"`
// Cookies
// The cookie values placed in cookie jar.
Cookies map[string]string `yaml:"cookies,omitempty" json:"cookies,omitempty" cty:"cookies"`
// CookiesString
// The value for future request Cookie headers.
CookiesString string `yaml:"cookies_string,omitempty" json:"cookies_string,omitempty" cty:"cookies_string"`
// Elapsed
// The number of seconds that elapsed while performing the download.
Elapsed int `yaml:"elapsed,omitempty" json:"elapsed,omitempty" cty:"elapsed"`
// Msg
// The HTTP message from the request.
Msg string `yaml:"msg,omitempty" json:"msg,omitempty" cty:"msg"`
// Path
// destination file/path
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// Redirected
// Whether the request was redirected.
Redirected bool `yaml:"redirected,omitempty" json:"redirected,omitempty" cty:"redirected"`
// Status
// The HTTP status code from the request.
Status int `yaml:"status,omitempty" json:"status,omitempty" cty:"status"`
// Url
// The actual URL used for the request.
Url string `yaml:"url,omitempty" json:"url,omitempty" cty:"url"`
// contains filtered or unexported fields
}
type User ¶
type User struct {
Params UserParams
Result UserResult
}
User (user) - Manage user accounts
Manage user accounts and user attributes.
For Windows targets, use the M(ansible.windows.win_user) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/user.py
func (*User) GetCommonResult ¶ added in v0.0.3
func (m *User) GetCommonResult() types.CommonReturn
func (*User) GetResultRaw ¶
type UserParams ¶
type UserParams struct {
// Append
// If C(yes), add the user to the groups specified in C(groups).
// If C(no), user will only be added to the groups specified in C(groups), removing them from all other groups.
//
// Default: no
// Required: false
Append bool `yaml:"append,omitempty" json:"append,omitempty" cty:"append"`
// Authorization
// Sets the authorization of the user.
// Does nothing when used with other platforms.
// Can set multiple authorizations using comma separation.
// To delete all authorizations, use C(authorization=”).
// Currently supported on Illumos/Solaris.
//
// Default: <no value>
// Required: false
Authorization string `yaml:"authorization,omitempty" json:"authorization,omitempty" cty:"authorization"`
// Comment
// Optionally sets the description (aka I(GECOS)) of user account.
//
// Default: <no value>
// Required: false
Comment string `yaml:"comment,omitempty" json:"comment,omitempty" cty:"comment"`
// CreateHome
// Unless set to C(no), a home directory will be made for the user when the account is created or if the home directory does not exist.
// Changed from C(createhome) to C(create_home) in Ansible 2.5.
//
// Default: yes
// Required: false
CreateHome bool `yaml:"create_home,omitempty" json:"create_home,omitempty" cty:"create_home"`
// Expires
// An expiry time for the user in epoch, it will be ignored on platforms that do not support this.
// Currently supported on GNU/Linux, FreeBSD, and DragonFlyBSD.
// Since Ansible 2.6 you can remove the expiry time by specifying a negative value. Currently supported on GNU/Linux and FreeBSD.
//
// Default: <no value>
// Required: false
Expires float64 `yaml:"expires,omitempty" json:"expires,omitempty" cty:"expires"`
// Force
// This only affects C(state=absent), it forces removal of the user and associated directories on supported platforms.
// The behavior is the same as C(userdel --force), check the man page for C(userdel) on your system for details and support.
// When used with C(generate_ssh_key=yes) this forces an existing key to be overwritten.
//
// Default: no
// Required: false
Force bool `yaml:"force,omitempty" json:"force,omitempty" cty:"force"`
// GenerateSshKey
// Whether to generate a SSH key for the user in question.
// This will B(not) overwrite an existing SSH key unless used with C(force=yes).
//
// Default: no
// Required: false
GenerateSshKey bool `yaml:"generate_ssh_key,omitempty" json:"generate_ssh_key,omitempty" cty:"generate_ssh_key"`
// Group
// Optionally sets the user's primary group (takes a group name).
//
// Default: <no value>
// Required: false
Group string `yaml:"group,omitempty" json:"group,omitempty" cty:"group"`
// Groups
// List of groups user will be added to.
// By default, the user is removed from all other groups. Configure C(append) to modify this.
// When set to an empty string C(”), the user is removed from all groups except the primary group.
// Before Ansible 2.3, the only input format allowed was a comma separated string.
//
// Default: <no value>
// Required: false
Groups []string `yaml:"groups,omitempty" json:"groups,omitempty" cty:"groups"`
// Hidden
// macOS only, optionally hide the user from the login window and system preferences.
// The default will be C(yes) if the I(system) option is used.
//
// Default: <no value>
// Required: false
Hidden bool `yaml:"hidden,omitempty" json:"hidden,omitempty" cty:"hidden"`
// Home
// Optionally set the user's home directory.
//
// Default: <no value>
// Required: false
Home string `yaml:"home,omitempty" json:"home,omitempty" cty:"home"`
// Local
// Forces the use of "local" command alternatives on platforms that implement it.
// This is useful in environments that use centralized authentication when you want to manipulate the local users (in other words, it uses C(luseradd) instead of C(useradd)).
// This will check C(/etc/passwd) for an existing account before invoking commands. If the local account database exists somewhere other than C(/etc/passwd), this setting will not work properly.
// This requires that the above commands as well as C(/etc/passwd) must exist on the target host, otherwise it will be a fatal error.
//
// Default: no
// Required: false
Local bool `yaml:"local,omitempty" json:"local,omitempty" cty:"local"`
// LoginClass
// Optionally sets the user's login class, a feature of most BSD OSs.
//
// Default: <no value>
// Required: false
LoginClass string `yaml:"login_class,omitempty" json:"login_class,omitempty" cty:"login_class"`
// MoveHome
// If set to C(yes) when used with C(home: ), attempt to move the user's old home directory to the specified directory if it isn't there already and the old home exists.
//
// Default: no
// Required: false
MoveHome bool `yaml:"move_home,omitempty" json:"move_home,omitempty" cty:"move_home"`
// Name
// Name of the user to create, remove or modify.
//
// Default: <no value>
// Required: true
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// NonUnique
// Optionally when used with the -u option, this option allows to change the user ID to a non-unique value.
//
// Default: no
// Required: false
NonUnique bool `yaml:"non_unique,omitempty" json:"non_unique,omitempty" cty:"non_unique"`
// Password
// Optionally set the user's password to this crypted value.
// On macOS systems, this value has to be cleartext. Beware of security issues.
// To create a an account with a locked/disabled password on Linux systems, set this to C('!') or C('*').
// To create a an account with a locked/disabled password on OpenBSD, set this to C('*************').
// See L(FAQ entry,https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module) for details on various ways to generate these password values.
//
// Default: <no value>
// Required: false
Password string `yaml:"password,omitempty" json:"password,omitempty" cty:"password"`
// PasswordExpireMax
// Maximum number of days between password change.
// Supported on Linux only.
//
// Default: <no value>
// Required: false
PasswordExpireMax int `yaml:"password_expire_max,omitempty" json:"password_expire_max,omitempty" cty:"password_expire_max"`
// PasswordExpireMin
// Minimum number of days between password change.
// Supported on Linux only.
//
// Default: <no value>
// Required: false
PasswordExpireMin int `yaml:"password_expire_min,omitempty" json:"password_expire_min,omitempty" cty:"password_expire_min"`
// PasswordLock
// Lock the password (C(usermod -L), C(usermod -U), C(pw lock)).
// Implementation differs by platform. This option does not always mean the user cannot login using other methods.
// This option does not disable the user, only lock the password.
// This must be set to C(False) in order to unlock a currently locked password. The absence of this parameter will not unlock a password.
// Currently supported on Linux, FreeBSD, DragonFlyBSD, NetBSD, OpenBSD.
//
// Default: <no value>
// Required: false
PasswordLock bool `yaml:"password_lock,omitempty" json:"password_lock,omitempty" cty:"password_lock"`
// Profile
// Sets the profile of the user.
// Does nothing when used with other platforms.
// Can set multiple profiles using comma separation.
// To delete all the profiles, use C(profile=”).
// Currently supported on Illumos/Solaris.
//
// Default: <no value>
// Required: false
Profile string `yaml:"profile,omitempty" json:"profile,omitempty" cty:"profile"`
// Remove
// This only affects C(state=absent), it attempts to remove directories associated with the user.
// The behavior is the same as C(userdel --remove), check the man page for details and support.
//
// Default: no
// Required: false
Remove bool `yaml:"remove,omitempty" json:"remove,omitempty" cty:"remove"`
// Role
// Sets the role of the user.
// Does nothing when used with other platforms.
// Can set multiple roles using comma separation.
// To delete all roles, use C(role=”).
// Currently supported on Illumos/Solaris.
//
// Default: <no value>
// Required: false
Role string `yaml:"role,omitempty" json:"role,omitempty" cty:"role"`
// Seuser
// Optionally sets the seuser type (user_u) on selinux enabled systems.
//
// Default: <no value>
// Required: false
Seuser string `yaml:"seuser,omitempty" json:"seuser,omitempty" cty:"seuser"`
// Shell
// Optionally set the user's shell.
// On macOS, before Ansible 2.5, the default shell for non-system users was C(/usr/bin/false). Since Ansible 2.5, the default shell for non-system users on macOS is C(/bin/bash).
// See notes for details on how other operating systems determine the default shell by the underlying tool.
//
// Default: <no value>
// Required: false
Shell string `yaml:"shell,omitempty" json:"shell,omitempty" cty:"shell"`
// Skeleton
// Optionally set a home skeleton directory.
// Requires C(create_home) option!
//
// Default: <no value>
// Required: false
Skeleton string `yaml:"skeleton,omitempty" json:"skeleton,omitempty" cty:"skeleton"`
// SshKeyBits
// Optionally specify number of bits in SSH key to create.
// The default value depends on ssh-keygen.
//
// Default: <no value>
// Required: false
SshKeyBits int `yaml:"ssh_key_bits,omitempty" json:"ssh_key_bits,omitempty" cty:"ssh_key_bits"`
// SshKeyComment
// Optionally define the comment for the SSH key.
//
// Default: ansible-generated on $HOSTNAME
// Required: false
SshKeyComment string `yaml:"ssh_key_comment,omitempty" json:"ssh_key_comment,omitempty" cty:"ssh_key_comment"`
// SshKeyFile
// Optionally specify the SSH key filename.
// If this is a relative filename then it will be relative to the user's home directory.
// This parameter defaults to I(.ssh/id_rsa).
//
// Default: <no value>
// Required: false
SshKeyFile string `yaml:"ssh_key_file,omitempty" json:"ssh_key_file,omitempty" cty:"ssh_key_file"`
// SshKeyPassphrase
// Set a passphrase for the SSH key.
// If no passphrase is provided, the SSH key will default to having no passphrase.
//
// Default: <no value>
// Required: false
SshKeyPassphrase string `yaml:"ssh_key_passphrase,omitempty" json:"ssh_key_passphrase,omitempty" cty:"ssh_key_passphrase"`
// SshKeyType
// Optionally specify the type of SSH key to generate.
// Available SSH key types will depend on implementation present on target host.
//
// Default: rsa
// Required: false
SshKeyType string `yaml:"ssh_key_type,omitempty" json:"ssh_key_type,omitempty" cty:"ssh_key_type"`
// State
// Whether the account should exist or not, taking action if the state is different from what is stated.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// System
// When creating an account C(state=present), setting this to C(yes) makes the user a system account.
// This setting cannot be changed on existing users.
//
// Default: no
// Required: false
System bool `yaml:"system,omitempty" json:"system,omitempty" cty:"system"`
// Uid
// Optionally sets the I(UID) of the user.
//
// Default: <no value>
// Required: false
Uid int `yaml:"uid,omitempty" json:"uid,omitempty" cty:"uid"`
// Umask
// Sets the umask of the user.
// Does nothing when used with other platforms.
// Currently supported on Linux.
// Requires C(local) is omitted or False.
//
// Default: <no value>
// Required: false
Umask string `yaml:"umask,omitempty" json:"umask,omitempty" cty:"umask"`
// UpdatePassword
// C(always) will update passwords if they differ.
// C(on_create) will only set the password for newly created users.
//
// Default: always
// Required: false
UpdatePassword string `yaml:"update_password,omitempty" json:"update_password,omitempty" cty:"update_password"`
// contains filtered or unexported fields
}
func (*UserParams) Get ¶ added in v0.0.6
func (p *UserParams) Get(name string) (interface{}, error)
func (*UserParams) Names ¶ added in v0.0.6
func (p *UserParams) Names() []string
func (*UserParams) Set ¶ added in v0.0.6
func (p *UserParams) Set(name string, value interface{}) error
type UserResult ¶
type UserResult struct {
types.CommonReturn
Raw string
// Append
// Whether or not to append the user to groups.
Append bool `yaml:"append,omitempty" json:"append,omitempty" cty:"append"`
// Comment
// Comment section from passwd file, usually the user name.
Comment string `yaml:"comment,omitempty" json:"comment,omitempty" cty:"comment"`
// CreateHome
// Whether or not to create the home directory.
CreateHome bool `yaml:"create_home,omitempty" json:"create_home,omitempty" cty:"create_home"`
// Force
// Whether or not a user account was forcibly deleted.
Force bool `yaml:"force,omitempty" json:"force,omitempty" cty:"force"`
// Group
// Primary user group ID
Group int `yaml:"group,omitempty" json:"group,omitempty" cty:"group"`
// Groups
// List of groups of which the user is a member.
Groups string `yaml:"groups,omitempty" json:"groups,omitempty" cty:"groups"`
// Home
// Path to user's home directory.
Home string `yaml:"home,omitempty" json:"home,omitempty" cty:"home"`
// MoveHome
// Whether or not to move an existing home directory.
MoveHome bool `yaml:"move_home,omitempty" json:"move_home,omitempty" cty:"move_home"`
// Name
// User account name.
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Password
// Masked value of the password.
Password string `yaml:"password,omitempty" json:"password,omitempty" cty:"password"`
// PasswordExpireMax
// Maximum number of days during which a password is valid.
PasswordExpireMax int `yaml:"password_expire_max,omitempty" json:"password_expire_max,omitempty" cty:"password_expire_max"`
// PasswordExpireMin
// Minimum number of days between password change
PasswordExpireMin int `yaml:"password_expire_min,omitempty" json:"password_expire_min,omitempty" cty:"password_expire_min"`
// Remove
// Whether or not to remove the user account.
Remove bool `yaml:"remove,omitempty" json:"remove,omitempty" cty:"remove"`
// Shell
// User login shell.
Shell string `yaml:"shell,omitempty" json:"shell,omitempty" cty:"shell"`
// SshFingerprint
// Fingerprint of generated SSH key.
SshFingerprint string `yaml:"ssh_fingerprint,omitempty" json:"ssh_fingerprint,omitempty" cty:"ssh_fingerprint"`
// SshKeyFile
// Path to generated SSH private key file.
SshKeyFile string `yaml:"ssh_key_file,omitempty" json:"ssh_key_file,omitempty" cty:"ssh_key_file"`
// SshPublicKey
// Generated SSH public key file.
SshPublicKey string `yaml:"ssh_public_key,omitempty" json:"ssh_public_key,omitempty" cty:"ssh_public_key"`
// Stderr
// Standard error from running commands.
Stderr string `yaml:"stderr,omitempty" json:"stderr,omitempty" cty:"stderr"`
// Stdout
// Standard output from running commands.
Stdout string `yaml:"stdout,omitempty" json:"stdout,omitempty" cty:"stdout"`
// System
// Whether or not the account is a system account.
System bool `yaml:"system,omitempty" json:"system,omitempty" cty:"system"`
// Uid
// User ID of the user account.
Uid int `yaml:"uid,omitempty" json:"uid,omitempty" cty:"uid"`
// contains filtered or unexported fields
}
func (*UserResult) Get ¶ added in v0.0.6
func (r *UserResult) Get(name string) (interface{}, error)
func (*UserResult) Names ¶ added in v0.0.6
func (r *UserResult) Names() []string
func (*UserResult) Set ¶ added in v0.0.6
func (r *UserResult) Set(name string, value interface{}) error
type WaitFor ¶
type WaitFor struct {
Params WaitForParams
Result WaitForResult
}
WaitFor (wait_for) - Waits for a condition before continuing
You can wait for a set amount of time C(timeout), this is the default if nothing is specified or just C(timeout) is specified. This does not produce an error.
Waiting for a port to become available is useful for when services are not immediately available after their init scripts return which is true of certain Java application servers.
It is also useful when starting guests with the M(community.libvirt.virt) module and needing to pause until they are ready.
This module can also be used to wait for a regex match a string to be present in a file.
In Ansible 1.6 and later, this module can also be used to wait for a file to be available or absent on the filesystem.
In Ansible 1.8 and later, this module can also be used to wait for active connections to be closed before continuing, useful if a node is being rotated out of a load balancer pool.
For Windows targets, use the M(ansible.windows.win_wait_for) module instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/wait_for.py
func NewWaitFor ¶
func NewWaitFor() *WaitFor
WaitFor (wait_for) - Waits for a condition before continuing
func (*WaitFor) GetCommonResult ¶ added in v0.0.3
func (m *WaitFor) GetCommonResult() types.CommonReturn
func (*WaitFor) GetResultRaw ¶
type WaitForParams ¶
type WaitForParams struct {
// ActiveConnectionStates
// The list of TCP connection states which are counted as active connections.
//
// Default: [ESTABLISHED FIN_WAIT1 FIN_WAIT2 SYN_RECV SYN_SENT TIME_WAIT]
// Required: false
ActiveConnectionStates []string `yaml:"active_connection_states,omitempty" json:"active_connection_states,omitempty" cty:"active_connection_states"`
// ConnectTimeout
// Maximum number of seconds to wait for a connection to happen before closing and retrying.
//
// Default: 5
// Required: false
ConnectTimeout int `yaml:"connect_timeout,omitempty" json:"connect_timeout,omitempty" cty:"connect_timeout"`
// Delay
// Number of seconds to wait before starting to poll.
//
// Default: 0
// Required: false
Delay int `yaml:"delay,omitempty" json:"delay,omitempty" cty:"delay"`
// ExcludeHosts
// List of hosts or IPs to ignore when looking for active TCP connections for C(drained) state.
//
// Default: <no value>
// Required: false
ExcludeHosts []string `yaml:"exclude_hosts,omitempty" json:"exclude_hosts,omitempty" cty:"exclude_hosts"`
// Host
// A resolvable hostname or IP address to wait for.
//
// Default: 127.0.0.1
// Required: false
Host string `yaml:"host,omitempty" json:"host,omitempty" cty:"host"`
// Msg
// This overrides the normal error message from a failure to meet the required conditions.
//
// Default: <no value>
// Required: false
Msg string `yaml:"msg,omitempty" json:"msg,omitempty" cty:"msg"`
// Path
// Path to a file on the filesystem that must exist before continuing.
// C(path) and C(port) are mutually exclusive parameters.
//
// Default: <no value>
// Required: false
Path string `yaml:"path,omitempty" json:"path,omitempty" cty:"path"`
// Port
// Port number to poll.
// C(path) and C(port) are mutually exclusive parameters.
//
// Default: <no value>
// Required: false
Port int `yaml:"port,omitempty" json:"port,omitempty" cty:"port"`
// SearchRegex
// Can be used to match a string in either a file or a socket connection.
// Defaults to a multiline regex.
//
// Default: <no value>
// Required: false
SearchRegex string `yaml:"search_regex,omitempty" json:"search_regex,omitempty" cty:"search_regex"`
// Sleep
// Number of seconds to sleep between checks.
// Before Ansible 2.3 this was hardcoded to 1 second.
//
// Default: 1
// Required: false
Sleep int `yaml:"sleep,omitempty" json:"sleep,omitempty" cty:"sleep"`
// State
// Either C(present), C(started), or C(stopped), C(absent), or C(drained).
// When checking a port C(started) will ensure the port is open, C(stopped) will check that it is closed, C(drained) will check for active connections.
// When checking for a file or a search string C(present) or C(started) will ensure that the file or string is present before continuing, C(absent) will check that file is absent or removed.
//
// Default: started
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// Timeout
// Maximum number of seconds to wait for, when used with another condition it will force an error.
// When used without other conditions it is equivalent of just sleeping.
//
// Default: 300
// Required: false
Timeout int `yaml:"timeout,omitempty" json:"timeout,omitempty" cty:"timeout"`
// contains filtered or unexported fields
}
func (*WaitForParams) Get ¶ added in v0.0.6
func (p *WaitForParams) Get(name string) (interface{}, error)
func (*WaitForParams) Names ¶ added in v0.0.6
func (p *WaitForParams) Names() []string
func (*WaitForParams) Set ¶ added in v0.0.6
func (p *WaitForParams) Set(name string, value interface{}) error
type WaitForResult ¶
type WaitForResult struct {
types.CommonReturn
Raw string
// Elapsed
// The number of seconds that elapsed while waiting
Elapsed int `yaml:"elapsed,omitempty" json:"elapsed,omitempty" cty:"elapsed"`
// MatchGroupdict
// Dictionary containing all the named subgroups of the match, keyed by the subgroup name, as returned by U(https://docs.python.org/3/library/re.html#re.MatchObject.groupdict)
MatchGroupdict map[string]string `yaml:"match_groupdict,omitempty" json:"match_groupdict,omitempty" cty:"match_groupdict"`
// MatchGroups
// Tuple containing all the subgroups of the match as returned by U(https://docs.python.org/3/library/re.html#re.MatchObject.groups)
MatchGroups []string `yaml:"match_groups,omitempty" json:"match_groups,omitempty" cty:"match_groups"`
// contains filtered or unexported fields
}
func (*WaitForResult) Get ¶ added in v0.0.6
func (r *WaitForResult) Get(name string) (interface{}, error)
func (*WaitForResult) Names ¶ added in v0.0.6
func (r *WaitForResult) Names() []string
func (*WaitForResult) Set ¶ added in v0.0.6
func (r *WaitForResult) Set(name string, value interface{}) error
type Yum ¶
Yum (yum) - Manages packages with the I(yum) package manager
Installs, upgrade, downgrades, removes, and lists packages and groups with the I(yum) package manager.
This module only works on Python 2. If you require Python 3 support see the M(ansible.builtin.dnf) module.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/yum.py
func (*Yum) GetCommonResult ¶ added in v0.0.3
func (m *Yum) GetCommonResult() types.CommonReturn
func (*Yum) GetResultRaw ¶
type YumParams ¶
type YumParams struct {
// AllowDowngrade
// Specify if the named package and version is allowed to downgrade a maybe already installed higher version of that package. Note that setting allow_downgrade=True can make this module behave in a non-idempotent way. The task could end up with a set of packages that does not match the complete list of specified packages to install (because dependencies between the downgraded package and others can cause changes to the packages which were in the earlier transaction).
//
// Default: no
// Required: false
AllowDowngrade bool `yaml:"allow_downgrade,omitempty" json:"allow_downgrade,omitempty" cty:"allow_downgrade"`
// Autoremove
// If C(yes), removes all "leaf" packages from the system that were originally installed as dependencies of user-installed packages but which are no longer required by any such package. Should be used alone or when state is I(absent)
// NOTE: This feature requires yum >= 3.4.3 (RHEL/CentOS 7+)
//
// Default: no
// Required: false
Autoremove bool `yaml:"autoremove,omitempty" json:"autoremove,omitempty" cty:"autoremove"`
// Bugfix
// If set to C(yes), and C(state=latest) then only installs updates that have been marked bugfix related.
//
// Default: no
// Required: false
Bugfix bool `yaml:"bugfix,omitempty" json:"bugfix,omitempty" cty:"bugfix"`
// Cacheonly
// Tells yum to run entirely from system cache; does not download or update metadata.
//
// Default: no
// Required: false
Cacheonly bool `yaml:"cacheonly,omitempty" json:"cacheonly,omitempty" cty:"cacheonly"`
// ConfFile
// The remote yum configuration file to use for the transaction.
//
// Default: <no value>
// Required: false
ConfFile string `yaml:"conf_file,omitempty" json:"conf_file,omitempty" cty:"conf_file"`
// DisableExcludes
// Disable the excludes defined in YUM config files.
// If set to C(all), disables all excludes.
// If set to C(main), disable excludes defined in [main] in yum.conf.
// If set to C(repoid), disable excludes defined for given repo id.
//
// Default: <no value>
// Required: false
DisableExcludes string `yaml:"disable_excludes,omitempty" json:"disable_excludes,omitempty" cty:"disable_excludes"`
// DisableGpgCheck
// Whether to disable the GPG checking of signatures of packages being installed. Has an effect only if state is I(present) or I(latest).
//
// Default: no
// Required: false
DisableGpgCheck bool `yaml:"disable_gpg_check,omitempty" json:"disable_gpg_check,omitempty" cty:"disable_gpg_check"`
// DisablePlugin
// I(Plugin) name to disable for the install/update operation. The disabled plugins will not persist beyond the transaction.
//
// Default: <no value>
// Required: false
DisablePlugin []string `yaml:"disable_plugin,omitempty" json:"disable_plugin,omitempty" cty:"disable_plugin"`
// Disablerepo
// I(Repoid) of repositories to disable for the install/update operation. These repos will not persist beyond the transaction. When specifying multiple repos, separate them with a C(",").
// As of Ansible 2.7, this can alternatively be a list instead of C(",") separated string
//
// Default: <no value>
// Required: false
Disablerepo []string `yaml:"disablerepo,omitempty" json:"disablerepo,omitempty" cty:"disablerepo"`
// DownloadDir
// Specifies an alternate directory to store packages.
// Has an effect only if I(download_only) is specified.
//
// Default: <no value>
// Required: false
DownloadDir string `yaml:"download_dir,omitempty" json:"download_dir,omitempty" cty:"download_dir"`
// DownloadOnly
// Only download the packages, do not install them.
//
// Default: no
// Required: false
DownloadOnly bool `yaml:"download_only,omitempty" json:"download_only,omitempty" cty:"download_only"`
// EnablePlugin
// I(Plugin) name to enable for the install/update operation. The enabled plugin will not persist beyond the transaction.
//
// Default: <no value>
// Required: false
EnablePlugin []string `yaml:"enable_plugin,omitempty" json:"enable_plugin,omitempty" cty:"enable_plugin"`
// Enablerepo
// I(Repoid) of repositories to enable for the install/update operation. These repos will not persist beyond the transaction. When specifying multiple repos, separate them with a C(",").
// As of Ansible 2.7, this can alternatively be a list instead of C(",") separated string
//
// Default: <no value>
// Required: false
Enablerepo []string `yaml:"enablerepo,omitempty" json:"enablerepo,omitempty" cty:"enablerepo"`
// Exclude
// Package name(s) to exclude when state=present, or latest
//
// Default: <no value>
// Required: false
Exclude []string `yaml:"exclude,omitempty" json:"exclude,omitempty" cty:"exclude"`
// InstallRepoquery
// If repoquery is not available, install yum-utils. If the system is registered to RHN or an RHN Satellite, repoquery allows for querying all channels assigned to the system. It is also required to use the 'list' parameter.
// NOTE: This will run and be logged as a separate yum transation which takes place before any other installation or removal.
// NOTE: This will use the system's default enabled repositories without regard for disablerepo/enablerepo given to the module.
//
// Default: yes
// Required: false
InstallRepoquery bool `yaml:"install_repoquery,omitempty" json:"install_repoquery,omitempty" cty:"install_repoquery"`
// InstallWeakDeps
// Will also install all packages linked by a weak dependency relation.
// NOTE: This feature requires yum >= 4 (RHEL/CentOS 8+)
//
// Default: yes
// Required: false
InstallWeakDeps bool `yaml:"install_weak_deps,omitempty" json:"install_weak_deps,omitempty" cty:"install_weak_deps"`
// Installroot
// Specifies an alternative installroot, relative to which all packages will be installed.
//
// Default: /
// Required: false
Installroot string `yaml:"installroot,omitempty" json:"installroot,omitempty" cty:"installroot"`
// List
// Package name to run the equivalent of yum list C(--show-duplicates <package>) against. In addition to listing packages, use can also list the following: C(installed), C(updates), C(available) and C(repos).
// This parameter is mutually exclusive with I(name).
//
// Default: <no value>
// Required: false
List string `yaml:"list,omitempty" json:"list,omitempty" cty:"list"`
// LockTimeout
// Amount of time to wait for the yum lockfile to be freed.
//
// Default: 30
// Required: false
LockTimeout int `yaml:"lock_timeout,omitempty" json:"lock_timeout,omitempty" cty:"lock_timeout"`
// Name
// A package name or package specifier with version, like C(name-1.0).
// Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name>=1.0)
// If a previous version is specified, the task also needs to turn C(allow_downgrade) on. See the C(allow_downgrade) documentation for caveats with downgrading packages.
// When using state=latest, this can be C('*') which means run C(yum -y update).
// You can also pass a url or a local path to a rpm file (using state=present). To operate on several packages this can accept a comma separated string of packages or (as of 2.0) a list of packages.
//
// Default: <no value>
// Required: false
Name []string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Releasever
// Specifies an alternative release from which all packages will be installed.
//
// Default: <no value>
// Required: false
Releasever string `yaml:"releasever,omitempty" json:"releasever,omitempty" cty:"releasever"`
// Security
// If set to C(yes), and C(state=latest) then only installs updates that have been marked security related.
//
// Default: no
// Required: false
Security bool `yaml:"security,omitempty" json:"security,omitempty" cty:"security"`
// SkipBroken
// Skip all unavailable packages or packages with broken dependencies without raising an error. Equivalent to passing the --skip-broken option.
//
// Default: no
// Required: false
SkipBroken bool `yaml:"skip_broken,omitempty" json:"skip_broken,omitempty" cty:"skip_broken"`
// Sslverify
// Disables SSL validation of the repository server for this transaction.
// This should be set to C(no) if one of the configured repositories is using an untrusted or self-signed certificate.
//
// Default: yes
// Required: false
Sslverify bool `yaml:"sslverify,omitempty" json:"sslverify,omitempty" cty:"sslverify"`
// State
// Whether to install (C(present) or C(installed), C(latest)), or remove (C(absent) or C(removed)) a package.
// C(present) and C(installed) will simply ensure that a desired package is installed.
// C(latest) will update the specified package if it's not of the latest available version.
// C(absent) and C(removed) will remove the specified package.
// Default is C(None), however in effect the default action is C(present) unless the C(autoremove) option is enabled for this module, then C(absent) is inferred.
//
// Default: <no value>
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// UpdateCache
// Force yum to check if cache is out of date and redownload if needed. Has an effect only if state is I(present) or I(latest).
//
// Default: no
// Required: false
UpdateCache bool `yaml:"update_cache,omitempty" json:"update_cache,omitempty" cty:"update_cache"`
// UpdateOnly
// When using latest, only update installed packages. Do not install packages.
// Has an effect only if state is I(latest)
//
// Default: no
// Required: false
UpdateOnly bool `yaml:"update_only,omitempty" json:"update_only,omitempty" cty:"update_only"`
// UseBackend
// This module supports C(yum) (as it always has), this is known as C(yum3)/C(YUM3)/C(yum-deprecated) by upstream yum developers. As of Ansible 2.7+, this module also supports C(YUM4), which is the "new yum" and it has an C(dnf) backend.
// By default, this module will select the backend based on the C(ansible_pkg_mgr) fact.
//
// Default: auto
// Required: false
UseBackend string `yaml:"use_backend,omitempty" json:"use_backend,omitempty" cty:"use_backend"`
// ValidateCerts
// This only applies if using a https url as the source of the rpm. e.g. for localinstall. If set to C(no), the SSL certificates will not be validated.
// This should only set to C(no) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
// Prior to 2.1 the code worked as if this was set to C(yes).
//
// Default: yes
// Required: false
ValidateCerts bool `yaml:"validate_certs,omitempty" json:"validate_certs,omitempty" cty:"validate_certs"`
// contains filtered or unexported fields
}
type YumRepository ¶
type YumRepository struct {
Params YumRepositoryParams
Result YumRepositoryResult
}
YumRepository (yum_repository) - Add or remove YUM repositories
Add or remove YUM repositories in RPM-based Linux distributions.
If you wish to update an existing repository definition use M(community.general.ini_file) instead.
Source: https://github.com/ansible/ansible/blob/v2.13.1/lib/ansible/modules/yum_repository.py
func NewYumRepository ¶
func NewYumRepository() *YumRepository
YumRepository (yum_repository) - Add or remove YUM repositories
func (*YumRepository) GetCommonResult ¶ added in v0.0.3
func (m *YumRepository) GetCommonResult() types.CommonReturn
func (*YumRepository) GetParams ¶
func (m *YumRepository) GetParams() types.Params
func (*YumRepository) GetResult ¶
func (m *YumRepository) GetResult() types.Result
func (*YumRepository) GetResultRaw ¶
func (m *YumRepository) GetResultRaw() string
func (*YumRepository) GetType ¶
func (m *YumRepository) GetType() string
type YumRepositoryParams ¶
type YumRepositoryParams struct {
// Async
// If set to C(yes) Yum will download packages and metadata from this repo in parallel, if possible.
//
// Default: yes
// Required: false
Async bool `yaml:"async,omitempty" json:"async,omitempty" cty:"async"`
// Bandwidth
// Maximum available network bandwidth in bytes/second. Used with the I(throttle) option.
// If I(throttle) is a percentage and bandwidth is C(0) then bandwidth throttling will be disabled. If I(throttle) is expressed as a data rate (bytes/sec) then this option is ignored. Default is C(0) (no bandwidth throttling).
//
// Default: 0
// Required: false
Bandwidth string `yaml:"bandwidth,omitempty" json:"bandwidth,omitempty" cty:"bandwidth"`
// Baseurl
// URL to the directory where the yum repository's 'repodata' directory lives.
// It can also be a list of multiple URLs.
// This, the I(metalink) or I(mirrorlist) parameters are required if I(state) is set to C(present).
//
// Default: <no value>
// Required: false
Baseurl []string `yaml:"baseurl,omitempty" json:"baseurl,omitempty" cty:"baseurl"`
// Cost
// Relative cost of accessing this repository. Useful for weighing one repo's packages as greater/less than any other.
//
// Default: 1000
// Required: false
Cost string `yaml:"cost,omitempty" json:"cost,omitempty" cty:"cost"`
// DeltarpmMetadataPercentage
// When the relative size of deltarpm metadata vs pkgs is larger than this, deltarpm metadata is not downloaded from the repo. Note that you can give values over C(100), so C(200) means that the metadata is required to be half the size of the packages. Use C(0) to turn off this check, and always download metadata.
//
// Default: 100
// Required: false
DeltarpmMetadataPercentage string `` /* 126-byte string literal not displayed */
// DeltarpmPercentage
// When the relative size of delta vs pkg is larger than this, delta is not used. Use C(0) to turn off delta rpm processing. Local repositories (with file:// I(baseurl)) have delta rpms turned off by default.
//
// Default: 75
// Required: false
DeltarpmPercentage string `yaml:"deltarpm_percentage,omitempty" json:"deltarpm_percentage,omitempty" cty:"deltarpm_percentage"`
// Description
// A human readable string describing the repository. This option corresponds to the "name" property in the repo file.
// This parameter is only required if I(state) is set to C(present).
//
// Default: <no value>
// Required: false
Description string `yaml:"description,omitempty" json:"description,omitempty" cty:"description"`
// Enabled
// This tells yum whether or not use this repository.
// Yum default value is C(true).
//
// Default: <no value>
// Required: false
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty" cty:"enabled"`
// Enablegroups
// Determines whether yum will allow the use of package groups for this repository.
// Yum default value is C(true).
//
// Default: <no value>
// Required: false
Enablegroups bool `yaml:"enablegroups,omitempty" json:"enablegroups,omitempty" cty:"enablegroups"`
// Exclude
// List of packages to exclude from updates or installs. This should be a space separated list. Shell globs using wildcards (eg. C(*) and C(?)) are allowed.
// The list can also be a regular YAML array.
//
// Default: <no value>
// Required: false
Exclude []string `yaml:"exclude,omitempty" json:"exclude,omitempty" cty:"exclude"`
// Failovermethod
// C(roundrobin) randomly selects a URL out of the list of URLs to start with and proceeds through each of them as it encounters a failure contacting the host.
// C(priority) starts from the first I(baseurl) listed and reads through them sequentially.
//
// Default: roundrobin
// Required: false
Failovermethod string `yaml:"failovermethod,omitempty" json:"failovermethod,omitempty" cty:"failovermethod"`
// File
// File name without the C(.repo) extension to save the repo in. Defaults to the value of I(name).
//
// Default: <no value>
// Required: false
File string `yaml:"file,omitempty" json:"file,omitempty" cty:"file"`
// Gpgcakey
// A URL pointing to the ASCII-armored CA key file for the repository.
//
// Default: <no value>
// Required: false
Gpgcakey string `yaml:"gpgcakey,omitempty" json:"gpgcakey,omitempty" cty:"gpgcakey"`
// Gpgcheck
// Tells yum whether or not it should perform a GPG signature check on packages.
// No default setting. If the value is not set, the system setting from C(/etc/yum.conf) or system default of C(no) will be used.
//
// Default: <no value>
// Required: false
Gpgcheck bool `yaml:"gpgcheck,omitempty" json:"gpgcheck,omitempty" cty:"gpgcheck"`
// Gpgkey
// A URL pointing to the ASCII-armored GPG key file for the repository.
// It can also be a list of multiple URLs.
//
// Default: <no value>
// Required: false
Gpgkey []string `yaml:"gpgkey,omitempty" json:"gpgkey,omitempty" cty:"gpgkey"`
// HttpCaching
// Determines how upstream HTTP caches are instructed to handle any HTTP downloads that Yum does.
// C(all) means that all HTTP downloads should be cached.
// C(packages) means that only RPM package downloads should be cached (but not repository metadata downloads).
// C(none) means that no HTTP downloads should be cached.
//
// Default: all
// Required: false
HttpCaching string `yaml:"http_caching,omitempty" json:"http_caching,omitempty" cty:"http_caching"`
// Include
// Include external configuration file. Both, local path and URL is supported. Configuration file will be inserted at the position of the I(include=) line. Included files may contain further include lines. Yum will abort with an error if an inclusion loop is detected.
//
// Default: <no value>
// Required: false
Include string `yaml:"include,omitempty" json:"include,omitempty" cty:"include"`
// Includepkgs
// List of packages you want to only use from a repository. This should be a space separated list. Shell globs using wildcards (eg. C(*) and C(?)) are allowed. Substitution variables (e.g. C($releasever)) are honored here.
// The list can also be a regular YAML array.
//
// Default: <no value>
// Required: false
Includepkgs []string `yaml:"includepkgs,omitempty" json:"includepkgs,omitempty" cty:"includepkgs"`
// IpResolve
// Determines how yum resolves host names.
// C(4) or C(IPv4) - resolve to IPv4 addresses only.
// C(6) or C(IPv6) - resolve to IPv6 addresses only.
//
// Default: whatever
// Required: false
IpResolve string `yaml:"ip_resolve,omitempty" json:"ip_resolve,omitempty" cty:"ip_resolve"`
// Keepalive
// This tells yum whether or not HTTP/1.1 keepalive should be used with this repository. This can improve transfer speeds by using one connection when downloading multiple files from a repository.
//
// Default: no
// Required: false
Keepalive bool `yaml:"keepalive,omitempty" json:"keepalive,omitempty" cty:"keepalive"`
// Keepcache
// Either C(1) or C(0). Determines whether or not yum keeps the cache of headers and packages after successful installation.
//
// Default: 1
// Required: false
Keepcache string `yaml:"keepcache,omitempty" json:"keepcache,omitempty" cty:"keepcache"`
// MetadataExpire
// Time (in seconds) after which the metadata will expire.
// Default value is 6 hours.
//
// Default: 21600
// Required: false
MetadataExpire string `yaml:"metadata_expire,omitempty" json:"metadata_expire,omitempty" cty:"metadata_expire"`
// MetadataExpireFilter
// Filter the I(metadata_expire) time, allowing a trade of speed for accuracy if a command doesn't require it. Each yum command can specify that it requires a certain level of timeliness quality from the remote repos. from "I'm about to install/upgrade, so this better be current" to "Anything that's available is good enough".
// C(never) - Nothing is filtered, always obey I(metadata_expire).
// C(read-only:past) - Commands that only care about past information are filtered from metadata expiring. Eg. I(yum history) info (if history needs to lookup anything about a previous transaction, then by definition the remote package was available in the past).
// C(read-only:present) - Commands that are balanced between past and future. Eg. I(yum list yum).
// C(read-only:future) - Commands that are likely to result in running other commands which will require the latest metadata. Eg. I(yum check-update).
// Note that this option does not override "yum clean expire-cache".
//
// Default: read-only:present
// Required: false
MetadataExpireFilter string `yaml:"metadata_expire_filter,omitempty" json:"metadata_expire_filter,omitempty" cty:"metadata_expire_filter"`
// Metalink
// Specifies a URL to a metalink file for the repomd.xml, a list of mirrors for the entire repository are generated by converting the mirrors for the repomd.xml file to a I(baseurl).
// This, the I(baseurl) or I(mirrorlist) parameters are required if I(state) is set to C(present).
//
// Default: <no value>
// Required: false
Metalink string `yaml:"metalink,omitempty" json:"metalink,omitempty" cty:"metalink"`
// Mirrorlist
// Specifies a URL to a file containing a list of baseurls.
// This, the I(baseurl) or I(metalink) parameters are required if I(state) is set to C(present).
//
// Default: <no value>
// Required: false
Mirrorlist string `yaml:"mirrorlist,omitempty" json:"mirrorlist,omitempty" cty:"mirrorlist"`
// MirrorlistExpire
// Time (in seconds) after which the mirrorlist locally cached will expire.
// Default value is 6 hours.
//
// Default: 21600
// Required: false
MirrorlistExpire string `yaml:"mirrorlist_expire,omitempty" json:"mirrorlist_expire,omitempty" cty:"mirrorlist_expire"`
// ModuleHotfixes
// Disable module RPM filtering and make all RPMs from the repository available. The default is C(None).
//
// Default: <no value>
// Required: false
ModuleHotfixes bool `yaml:"module_hotfixes,omitempty" json:"module_hotfixes,omitempty" cty:"module_hotfixes"`
// Name
// Unique repository ID. This option builds the section name of the repository in the repo file.
// This parameter is only required if I(state) is set to C(present) or C(absent).
//
// Default: <no value>
// Required: true
Name string `yaml:"name,omitempty" json:"name,omitempty" cty:"name"`
// Password
// Password to use with the username for basic authentication.
//
// Default: <no value>
// Required: false
Password string `yaml:"password,omitempty" json:"password,omitempty" cty:"password"`
// Priority
// Enforce ordered protection of repositories. The value is an integer from 1 to 99.
// This option only works if the YUM Priorities plugin is installed.
//
// Default: 99
// Required: false
Priority string `yaml:"priority,omitempty" json:"priority,omitempty" cty:"priority"`
// Protect
// Protect packages from updates from other repositories.
//
// Default: no
// Required: false
Protect bool `yaml:"protect,omitempty" json:"protect,omitempty" cty:"protect"`
// Proxy
// URL to the proxy server that yum should use. Set to C(_none_) to disable the global proxy setting.
//
// Default: <no value>
// Required: false
Proxy string `yaml:"proxy,omitempty" json:"proxy,omitempty" cty:"proxy"`
// ProxyPassword
// Password for this proxy.
//
// Default: <no value>
// Required: false
ProxyPassword string `yaml:"proxy_password,omitempty" json:"proxy_password,omitempty" cty:"proxy_password"`
// ProxyUsername
// Username to use for proxy.
//
// Default: <no value>
// Required: false
ProxyUsername string `yaml:"proxy_username,omitempty" json:"proxy_username,omitempty" cty:"proxy_username"`
// RepoGpgcheck
// This tells yum whether or not it should perform a GPG signature check on the repodata from this repository.
//
// Default: no
// Required: false
RepoGpgcheck bool `yaml:"repo_gpgcheck,omitempty" json:"repo_gpgcheck,omitempty" cty:"repo_gpgcheck"`
// Reposdir
// Directory where the C(.repo) files will be stored.
//
// Default: /etc/yum.repos.d
// Required: false
Reposdir string `yaml:"reposdir,omitempty" json:"reposdir,omitempty" cty:"reposdir"`
// Retries
// Set the number of times any attempt to retrieve a file should retry before returning an error. Setting this to C(0) makes yum try forever.
//
// Default: 10
// Required: false
Retries string `yaml:"retries,omitempty" json:"retries,omitempty" cty:"retries"`
// S3Enabled
// Enables support for S3 repositories.
// This option only works if the YUM S3 plugin is installed.
//
// Default: no
// Required: false
S3Enabled bool `yaml:"s3_enabled,omitempty" json:"s3_enabled,omitempty" cty:"s3_enabled"`
// If set to C(yes) yum will continue running if this repository cannot be contacted for any reason. This should be set carefully as all repos are consulted for any given command.
//
// Default: no
// Required: false
SkipIfUnavailable bool `yaml:"skip_if_unavailable,omitempty" json:"skip_if_unavailable,omitempty" cty:"skip_if_unavailable"`
// SslCheckCertPermissions
// Whether yum should check the permissions on the paths for the certificates on the repository (both remote and local).
// If we can't read any of the files then yum will force I(skip_if_unavailable) to be C(yes). This is most useful for non-root processes which use yum on repos that have client cert files which are readable only by root.
//
// Default: no
// Required: false
SslCheckCertPermissions bool `yaml:"ssl_check_cert_permissions,omitempty" json:"ssl_check_cert_permissions,omitempty" cty:"ssl_check_cert_permissions"`
// Sslcacert
// Path to the directory containing the databases of the certificate authorities yum should use to verify SSL certificates.
//
// Default: <no value>
// Required: false
Sslcacert string `yaml:"sslcacert,omitempty" json:"sslcacert,omitempty" cty:"sslcacert"`
// Sslclientcert
// Path to the SSL client certificate yum should use to connect to repos/remote sites.
//
// Default: <no value>
// Required: false
Sslclientcert string `yaml:"sslclientcert,omitempty" json:"sslclientcert,omitempty" cty:"sslclientcert"`
// Sslclientkey
// Path to the SSL client key yum should use to connect to repos/remote sites.
//
// Default: <no value>
// Required: false
Sslclientkey string `yaml:"sslclientkey,omitempty" json:"sslclientkey,omitempty" cty:"sslclientkey"`
// Sslverify
// Defines whether yum should verify SSL certificates/hosts at all.
//
// Default: yes
// Required: false
Sslverify bool `yaml:"sslverify,omitempty" json:"sslverify,omitempty" cty:"sslverify"`
// State
// State of the repo file.
//
// Default: present
// Required: false
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// Throttle
// Enable bandwidth throttling for downloads.
// This option can be expressed as a absolute data rate in bytes/sec. An SI prefix (k, M or G) may be appended to the bandwidth value.
//
// Default: <no value>
// Required: false
Throttle string `yaml:"throttle,omitempty" json:"throttle,omitempty" cty:"throttle"`
// Timeout
// Number of seconds to wait for a connection before timing out.
//
// Default: 30
// Required: false
Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty" cty:"timeout"`
// UiRepoidVars
// When a repository id is displayed, append these yum variables to the string if they are used in the I(baseurl)/etc. Variables are appended in the order listed (and found).
//
// Default: releasever basearch
// Required: false
UiRepoidVars string `yaml:"ui_repoid_vars,omitempty" json:"ui_repoid_vars,omitempty" cty:"ui_repoid_vars"`
// Username
// Username to use for basic authentication to a repo or really any url.
//
// Default: <no value>
// Required: false
Username string `yaml:"username,omitempty" json:"username,omitempty" cty:"username"`
// contains filtered or unexported fields
}
func (*YumRepositoryParams) Get ¶ added in v0.0.6
func (p *YumRepositoryParams) Get(name string) (interface{}, error)
func (*YumRepositoryParams) Names ¶ added in v0.0.6
func (p *YumRepositoryParams) Names() []string
func (*YumRepositoryParams) Set ¶ added in v0.0.6
func (p *YumRepositoryParams) Set(name string, value interface{}) error
type YumRepositoryResult ¶
type YumRepositoryResult struct {
types.CommonReturn
Raw string
// Repo
// repository name
Repo string `yaml:"repo,omitempty" json:"repo,omitempty" cty:"repo"`
// State
// state of the target, after execution
State string `yaml:"state,omitempty" json:"state,omitempty" cty:"state"`
// contains filtered or unexported fields
}
func (*YumRepositoryResult) Get ¶ added in v0.0.6
func (r *YumRepositoryResult) Get(name string) (interface{}, error)
func (*YumRepositoryResult) Names ¶ added in v0.0.6
func (r *YumRepositoryResult) Names() []string
func (*YumRepositoryResult) Set ¶ added in v0.0.6
func (r *YumRepositoryResult) Set(name string, value interface{}) error
type YumResult ¶
type YumResult struct {
types.CommonReturn
Raw string
// contains filtered or unexported fields
}
Source Files
¶
- apt.go
- apt_key.go
- apt_repository.go
- assemble.go
- async_status.go
- blockinfile.go
- command.go
- cron.go
- debconf.go
- dnf.go
- dpkg_selections.go
- expect.go
- file.go
- find.go
- get_url.go
- getent.go
- git.go
- group.go
- hostname.go
- iptables.go
- known_hosts.go
- lineinfile.go
- pip.go
- reboot.go
- replace.go
- rpm_key.go
- setup.go
- slurp.go
- spec.go
- stat.go
- subversion.go
- systemd.go
- sysvinit.go
- tempfile.go
- template.go
- unarchive.go
- uri.go
- user.go
- wait_for.go
- yum.go
- yum_repository.go