Documentation ¶
Index ¶
- func NewAnsibleSSHSettingsSchema() *schema.Schema
- func NewDefaultsSchema() *schema.Schema
- func NewModuleSchema() *schema.Schema
- func NewPlaySchema() *schema.Schema
- func NewPlaybookSchema() *schema.Schema
- func NewRemoteSchema() *schema.Schema
- func ResolveDirectory(path string) (string, error)
- func ResolvePath(path string) (string, error)
- func VfPathDirectory(val interface{}, key string) (warns []string, errs []error)
- type AnsibleSSHSettings
- func (v *AnsibleSSHSettings) BastionUserKnownHostsFile() string
- func (v *AnsibleSSHSettings) ConnectAttempts() int
- func (v *AnsibleSSHSettings) ConnectTimeoutSeconds() int
- func (v *AnsibleSSHSettings) InsecureBastionNoStrictHostKeyChecking() bool
- func (v *AnsibleSSHSettings) InsecureNoStrictHostKeyChecking() bool
- func (v *AnsibleSSHSettings) SSHKeyscanSeconds() int
- func (v *AnsibleSSHSettings) SetOverrideStrictHostKeyChecking()
- func (v *AnsibleSSHSettings) UserKnownHostsFile() string
- type Defaults
- type LocalModeAnsibleArgs
- type Module
- type Play
- func (v *Play) AdditionalContent() string
- func (v *Play) Become() bool
- func (v *Play) BecomeMethod() string
- func (v *Play) BecomeUser() string
- func (v *Play) Check() bool
- func (v *Play) Diff() bool
- func (v *Play) Enabled() bool
- func (v *Play) Entity() interface{}
- func (v *Play) ExtraVars() map[string]interface{}
- func (v *Play) Forks() int
- func (v *Play) Groups() []string
- func (v *Play) Hosts() []string
- func (v *Play) InventoryFile() string
- func (v *Play) Limit() string
- func (v *Play) SetOverrideInventoryFile(path string)
- func (v *Play) SetOverrideVaultID(paths []string)
- func (v *Play) SetOverrideVaultPasswordPath(path string)
- func (v *Play) ToCommand(ansibleArgs LocalModeAnsibleArgs) (string, error)
- func (v *Play) ToLocalCommand(ansibleArgs LocalModeAnsibleArgs, ansibleSSHSettings *AnsibleSSHSettings) (string, error)
- func (v *Play) VaultID() []string
- func (v *Play) VaultPasswordFile() string
- func (v *Play) Verbose() bool
- type Playbook
- func (v *Playbook) FilePath() string
- func (v *Playbook) ForceHandlers() bool
- func (v *Playbook) RolesPath() []string
- func (v *Playbook) SetOverrideFilePath(path string)
- func (v *Playbook) SetOverrideRolesPath(path []string)
- func (v *Playbook) SkipTags() []string
- func (v *Playbook) StartAtTask() string
- func (v *Playbook) Tags() []string
- type RemoteSettings
- func (v *RemoteSettings) BootstrapDirectory() string
- func (v *RemoteSettings) InstallVersion() string
- func (v *RemoteSettings) IsRemoteInUse() bool
- func (v *RemoteSettings) LocalInstallerPath() string
- func (v *RemoteSettings) RemoteInstallerPath() string
- func (v *RemoteSettings) SkipCleanup() bool
- func (v *RemoteSettings) SkipInstall() bool
- func (v *RemoteSettings) UseSudo() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAnsibleSSHSettingsSchema ¶
NewAnsibleSSHSettingsSchema returns a new AnsibleSSHSettings schema.
func NewDefaultsSchema ¶
NewDefaultsSchema returns a new defaults schema.
func NewModuleSchema ¶
NewModuleSchema return a new Ansible module schema.
func NewPlaybookSchema ¶
NewPlaybookSchema returns a new Ansible playbook schema.
func NewRemoteSchema ¶
NewRemoteSchema returns a new remote schema.
func ResolveDirectory ¶
ResolveDirectory checks if a path exists and is a directory.
func ResolvePath ¶
ResolvePath checks if a path exists.
func VfPathDirectory ¶
VfPathDirectory validates existence of a path and that the path is a directory.
Types ¶
type AnsibleSSHSettings ¶
type AnsibleSSHSettings struct {
// contains filtered or unexported fields
}
AnsibleSSHSettings represents Ansible process SSH settings.
func NewAnsibleSSHSettingsFromInterface ¶
func NewAnsibleSSHSettingsFromInterface(i interface{}, ok bool) *AnsibleSSHSettings
NewAnsibleSSHSettingsFromInterface reads AnsibleSSHSettings configuration from Terraform schema.
func (*AnsibleSSHSettings) BastionUserKnownHostsFile ¶
func (v *AnsibleSSHSettings) BastionUserKnownHostsFile() string
BastionUserKnownHostsFile returns a path to the user known hosts file for the bastion host.
func (*AnsibleSSHSettings) ConnectAttempts ¶
func (v *AnsibleSSHSettings) ConnectAttempts() int
ConnectAttempts reutrn Ansible process SSH connection attempt count.
func (*AnsibleSSHSettings) ConnectTimeoutSeconds ¶
func (v *AnsibleSSHSettings) ConnectTimeoutSeconds() int
ConnectTimeoutSeconds reutrn Ansible process SSH connection timeout.
func (*AnsibleSSHSettings) InsecureBastionNoStrictHostKeyChecking ¶
func (v *AnsibleSSHSettings) InsecureBastionNoStrictHostKeyChecking() bool
InsecureBastionNoStrictHostKeyChecking if true, SSH to the bastion host uses -o StrictHostKeyChecking=no.
func (*AnsibleSSHSettings) InsecureNoStrictHostKeyChecking ¶
func (v *AnsibleSSHSettings) InsecureNoStrictHostKeyChecking() bool
InsecureNoStrictHostKeyChecking if true, SSH to the target host uses -o StrictHostKeyChecking=no.
func (*AnsibleSSHSettings) SSHKeyscanSeconds ¶
func (v *AnsibleSSHSettings) SSHKeyscanSeconds() int
SSHKeyscanSeconds reutrn Ansible process SSH keyscan timeout.
func (*AnsibleSSHSettings) SetOverrideStrictHostKeyChecking ¶
func (v *AnsibleSSHSettings) SetOverrideStrictHostKeyChecking()
SetOverrideStrictHostKeyChecking is used by the provisioner when attached to a null_resource
func (*AnsibleSSHSettings) UserKnownHostsFile ¶
func (v *AnsibleSSHSettings) UserKnownHostsFile() string
UserKnownHostsFile returns a path to the user known hosts file for the target host.
type Defaults ¶
type Defaults struct {
// contains filtered or unexported fields
}
Defaults represents default settings for each consequent play.
func NewDefaultsFromInterface ¶
NewDefaultsFromInterface reads Defaults configuration from Terraform schema.
func NewDefaultsFromMapInterface ¶
NewDefaultsFromMapInterface reads Defaults configuration from a map.
func (*Defaults) BecomeMethod ¶
BecomeMethod returns become method.
func (*Defaults) BecomeUser ¶
BecomeUser returns become user.
type LocalModeAnsibleArgs ¶
type LocalModeAnsibleArgs struct { Username string Port int PemFile string KnownHostsFile string BastionKnownHostsFile string BastionUsername string BastionHost string BastionPort int BastionPemFile string }
LocalModeAnsibleArgs is used by the local provisioner to feed Ansible with correct connection setup data.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module represents module settings.
func NewModuleFromInterface ¶
func NewModuleFromInterface(i interface{}) *Module
NewModuleFromInterface reads Module configuration from Terraform schema.
func (*Module) Background ¶
Background represents Ansible --background flag.
func (*Module) HostPattern ¶
HostPattern represents Ansible host pattern argument.
type Play ¶
type Play struct {
// contains filtered or unexported fields
}
Play return a new Ansible item to play.
func NewPlayFromInterface ¶
NewPlayFromInterface reads Play configuration from Terraform schema.
func NewPlayFromMapInterface ¶
NewPlayFromMapInterface reads Play configuration from a map.
func (*Play) AdditionalContent ¶
AdditionalContent represents additional text to append to the inventory file
func (*Play) BecomeMethod ¶
BecomeMethod represents Ansible --become-method flag.
func (*Play) BecomeUser ¶
BecomeUser represents Ansible --become-user flag.
func (*Play) Enabled ¶
Enabled controls the execution of a play. Play will be skipped if this value is false.
func (*Play) InventoryFile ¶
InventoryFile represents Ansible --inventory-file flag.
func (*Play) SetOverrideInventoryFile ¶
SetOverrideInventoryFile is used by the provisioner in the following cases: - remote provisioner not given an inventory_file, a generated temporary file used - local mode always writes a temporary inventory file, such file has to be removed after provisioning
func (*Play) SetOverrideVaultID ¶
SetOverrideVaultID is used by remote provisioner when vault id files are defined. After uploading the files to the machine, the paths are updated to the remote paths, such that Ansible can be given correct remote locations.
func (*Play) SetOverrideVaultPasswordPath ¶
SetOverrideVaultPasswordPath is used by remote provisioner when a vault password file is defined. After uploading the file to the machine, the path is updated to the remote path, such that Ansible can be given the correct remote location.
func (*Play) ToCommand ¶
func (v *Play) ToCommand(ansibleArgs LocalModeAnsibleArgs) (string, error)
ToCommand serializes the play to an executable Ansible command.
func (*Play) ToLocalCommand ¶
func (v *Play) ToLocalCommand(ansibleArgs LocalModeAnsibleArgs, ansibleSSHSettings *AnsibleSSHSettings) (string, error)
ToLocalCommand serializes the play to an executable local provisioning Ansible command.
func (*Play) VaultPasswordFile ¶
VaultPasswordFile represents Ansible --vault-password-file flag.
type Playbook ¶
type Playbook struct {
// contains filtered or unexported fields
}
Playbook represents playbook settings.
func NewPlaybookFromInterface ¶
func NewPlaybookFromInterface(i interface{}) *Playbook
NewPlaybookFromInterface reads Playbook configuration from Terraform schema.
func (*Playbook) ForceHandlers ¶
ForceHandlers represents Ansible Playbook --force-handlers flag.
func (*Playbook) RolesPath ¶
RolesPath appends role directories to ANSIBLE_ROLES_PATH environment variable, as documented in https://docs.ansible.com/ansible/2.5/reference_appendices/config.html#envvar-ANSIBLE_ROLES_PATH
func (*Playbook) SetOverrideFilePath ¶
SetOverrideFilePath is used by the remote provisioner to reference the correct playbook location after the upload to the provisioned machine.
func (*Playbook) SetOverrideRolesPath ¶
SetOverrideRolesPath is used by the remote provisioner to reference the correct role locations after the upload to the provisioned machine.
func (*Playbook) StartAtTask ¶
StartAtTask represents Ansible Playbook --start-at-task flag.
type RemoteSettings ¶
type RemoteSettings struct {
// contains filtered or unexported fields
}
RemoteSettings represents remote settings.
func NewRemoteSettingsFromInterface ¶
func NewRemoteSettingsFromInterface(i interface{}, ok bool) *RemoteSettings
NewRemoteSettingsFromInterface reads Remote configuration from Terraform schema.
func NewRemoteSettingsFromMapInterface ¶
func NewRemoteSettingsFromMapInterface(vals map[string]interface{}, ok bool) *RemoteSettings
NewRemoteSettingsFromMapInterface reads Remote configuration from a map.
func (*RemoteSettings) BootstrapDirectory ¶
func (v *RemoteSettings) BootstrapDirectory() string
BootstrapDirectory returns a path to where the playbooks, roles, inventory fiels, vault password / ID files and such are uploded to.
func (*RemoteSettings) InstallVersion ¶
func (v *RemoteSettings) InstallVersion() string
InstallVersion returns Ansible version to install, empty string means latest.
func (*RemoteSettings) IsRemoteInUse ¶
func (v *RemoteSettings) IsRemoteInUse() bool
IsRemoteInUse returns true remote provisioning is in use.
func (*RemoteSettings) LocalInstallerPath ¶
func (v *RemoteSettings) LocalInstallerPath() string
LocalInstallerPath returns a path to the custom Ansible installer.
func (*RemoteSettings) RemoteInstallerPath ¶
func (v *RemoteSettings) RemoteInstallerPath() string
RemoteInstallerPath returns a path to the where the Ansible installer script in uploaded to and executed from. This is essentially remote_installer_directory with /ansible-installer appended.
func (*RemoteSettings) SkipCleanup ¶
func (v *RemoteSettings) SkipCleanup() bool
SkipCleanup returns true is Ansible installation should be cleaned up during remote provisioning, false otherwise.
func (*RemoteSettings) SkipInstall ¶
func (v *RemoteSettings) SkipInstall() bool
SkipInstall returns true is Ansible installation should be skipped during remote provisioning, false otherwise.
func (*RemoteSettings) UseSudo ¶
func (v *RemoteSettings) UseSudo() bool
UseSudo returns true is sudo should be use, false otherwise.