Documentation ¶
Overview ¶
Package ansible contains libraries for interacting with the Ansible IT automation tool.
Index ¶
- Constants
- func EventStream(in io.Reader) <-chan Event
- type ClusterCatalog
- type Event
- type HandlerTaskStartEvent
- type Inventory
- type NFSVolume
- type Node
- type OutputFormat
- type PlayStartEvent
- type PlaybookEndEvent
- type PlaybookStartEvent
- type Role
- type Runner
- type RunnerFailedEvent
- type RunnerItemFailedEvent
- type RunnerItemOKEvent
- type RunnerItemRetryEvent
- type RunnerOKEvent
- type RunnerSkippedEvent
- type RunnerUnreachableEvent
- type TaskStartEvent
Constants ¶
const ( // RawFormat is the raw Ansible output formatting RawFormat = OutputFormat("raw") // JSONLinesFormat is a JSON Lines representation of Ansible events JSONLinesFormat = OutputFormat("json_lines") )
Variables ¶
This section is empty.
Functions ¶
func EventStream ¶
EventStream reads JSON lines from the incoming stream, and convert them into a stream of events.
Types ¶
type ClusterCatalog ¶ added in v1.2.0
type ClusterCatalog struct { ClusterName string `yaml:"kubernetes_cluster_name"` AdminPassword string `yaml:"kubernetes_admin_password"` TLSDirectory string `yaml:"tls_directory"` CalicoNetworkType string `yaml:"calico_network_type"` ServicesCIDR string `yaml:"kubernetes_services_cidr"` PodCIDR string `yaml:"kubernetes_pods_cidr"` DNSServiceIP string `yaml:"kubernetes_dns_service_ip"` EnableModifyHosts bool `yaml:"modify_hosts_file"` EnableCalicoPolicy bool `yaml:"enable_calico_policy"` EnablePackageInstallation bool `yaml:"allow_package_installation"` DisconnectedInstallation bool `yaml:"disconnected_installation"` KuberangPath string `yaml:"kuberang_path"` LoadBalancedFQDN string `yaml:"kubernetes_load_balanced_fqdn"` EnablePrivateDockerRegistry bool `yaml:"use_private_docker_registry"` EnableInternalDockerRegistry bool `yaml:"setup_internal_docker_registry"` DockerCAPath string `yaml:"docker_certificates_ca_path"` DockerRegistryAddress string `yaml:"docker_registry_address"` DockerRegistryPort string `yaml:"docker_registry_port"` ForceEtcdRestart bool `yaml:"force_etcd_restart"` ForceAPIServerRestart bool `yaml:"force_apiserver_restart"` ForceControllerManagerRestart bool `yaml:"force_controller_manager_restart"` ForceSchedulerRestart bool `yaml:"force_scheduler_restart"` ForceProxyRestart bool `yaml:"force_proxy_restart"` ForceKubeletRestart bool `yaml:"force_kubelet_restart"` ForceCalicoNodeRestart bool `yaml:"force_calico_node_restart"` ForceDockerRestart bool `yaml:"force_docker_restart"` EnableConfigureIngress bool `yaml:"configure_ingress"` KismaticPreflightCheckerLinux string `yaml:"kismatic_preflight_checker"` KismaticPreflightCheckerLocal string `yaml:"kismatic_preflight_checker_local"` WorkerNode string `yaml:"worker_node"` NFSVolumes []NFSVolume `yaml:"nfs_volumes"` EnableGluster bool `yaml:"configure_storage"` // volume add vars VolumeName string `yaml:"volume_name"` VolumeReplicaCount int `yaml:"volume_replica_count"` VolumeDistributionCount int `yaml:"volume_distribution_count"` VolumeStorageClass string `yaml:"volume_storage_class"` VolumeQuotaGB int `yaml:"volume_quota_gb"` VolumeQuotaBytes int `yaml:"volume_quota_bytes"` VolumeMount string `yaml:"volume_mount"` VolumeAllowedIPs string `yaml:"volume_allow_ips"` TargetVersion string `yaml:"kismatic_short_version"` OnlineUpgrade bool `yaml:"online_upgrade"` DiagnosticsDirectory string `yaml:"diagnostics_dir"` DiagnosticsDateTime string `yaml:"diagnostics_date_time"` }
func (*ClusterCatalog) EnableRestart ¶ added in v1.2.0
func (c *ClusterCatalog) EnableRestart()
func (*ClusterCatalog) ToYAML ¶ added in v1.2.0
func (c *ClusterCatalog) ToYAML() ([]byte, error)
type Event ¶
type Event interface { // Type is the name of the event type Type() string }
Event produced by Ansible when running a playbook
type HandlerTaskStartEvent ¶
type HandlerTaskStartEvent struct {
// contains filtered or unexported fields
}
HandlerTaskStartEvent signals the beginning of a handler task
func (*HandlerTaskStartEvent) Type ¶
func (e *HandlerTaskStartEvent) Type() string
type Inventory ¶
type Inventory struct {
Roles []Role
}
Inventory is a collection of Nodes, keyed by role.
type Node ¶
type Node struct { // Host is the hostname of the target node Host string // PublicIP is the publicly accessible IP PublicIP string // InternalIP is the internal IP, if different from PublicIP. InternalIP string // SSHPrivateKey is the private key to be used for SSH authentication SSHPrivateKey string // SSHPort is the SSH port number for connecting to the node SSHPort int // SSHUser is the SSH user for logging into the node SSHUser string }
Node is an Ansible target node
type OutputFormat ¶
type OutputFormat string
OutputFormat is used for controlling the STDOUT format of the Ansible runner
type PlayStartEvent ¶
type PlayStartEvent struct {
// contains filtered or unexported fields
}
PlayStartEvent signals the beginning of a play
func (*PlayStartEvent) Type ¶
func (e *PlayStartEvent) Type() string
type PlaybookEndEvent ¶
type PlaybookEndEvent struct {
// contains filtered or unexported fields
}
PlaybookEndEvent signals the beginning of a playbook
func (*PlaybookEndEvent) Type ¶
func (e *PlaybookEndEvent) Type() string
type PlaybookStartEvent ¶
type PlaybookStartEvent struct { Count int // contains filtered or unexported fields }
PlaybookStartEvent signals the beginning of a playbook
func (*PlaybookStartEvent) Type ¶
func (e *PlaybookStartEvent) Type() string
type Role ¶
type Role struct { // Name of the role Name string // The nodes that belong to this role Nodes []Node }
Role is an Ansible role, containing nodes that belong to the role.
type Runner ¶
type Runner interface { // StartPlaybook runs the playbook asynchronously with the given inventory and extra vars. // It returns a read-only channel that must be consumed for the playbook execution to proceed. StartPlaybook(playbookFile string, inventory Inventory, cc ClusterCatalog) (<-chan Event, error) // WaitPlaybook blocks until the execution of the playbook is complete. If an error occurred, // it is returned. Otherwise, returns nil to signal the completion of the playbook. WaitPlaybook() error // StartPlaybookOnNode runs the playbook asynchronously with the given inventory and extra vars // against the specific node. // It returns a read-only channel that must be consumed for the playbook execution to proceed. StartPlaybookOnNode(playbookFile string, inventory Inventory, cc ClusterCatalog, node ...string) (<-chan Event, error) }
Runner for running Ansible playbooks
type RunnerFailedEvent ¶
type RunnerFailedEvent struct {
// contains filtered or unexported fields
}
RunnerFailedEvent signals a failure when executing a runner
func (*RunnerFailedEvent) Type ¶
func (e *RunnerFailedEvent) Type() string
type RunnerItemFailedEvent ¶ added in v1.1.1
type RunnerItemFailedEvent struct {
// contains filtered or unexported fields
}
RunnerItemFailedEvent signals the failure of a task with a specific item
func (*RunnerItemFailedEvent) Type ¶ added in v1.1.1
func (e *RunnerItemFailedEvent) Type() string
type RunnerItemOKEvent ¶
type RunnerItemOKEvent struct {
// contains filtered or unexported fields
}
RunnerItemOKEvent signals the successful completion of a runner item
func (*RunnerItemOKEvent) Type ¶
func (e *RunnerItemOKEvent) Type() string
type RunnerItemRetryEvent ¶
type RunnerItemRetryEvent struct {
// contains filtered or unexported fields
}
RunnerItemRetryEvent signals the retry of a runner item
func (*RunnerItemRetryEvent) Type ¶
func (e *RunnerItemRetryEvent) Type() string
type RunnerOKEvent ¶
type RunnerOKEvent struct {
// contains filtered or unexported fields
}
RunnerOKEvent signals the successful completion of a runner
func (*RunnerOKEvent) Type ¶
func (e *RunnerOKEvent) Type() string
type RunnerSkippedEvent ¶
type RunnerSkippedEvent struct {
// contains filtered or unexported fields
}
RunnerSkippedEvent is raised when a runner is skipped
func (*RunnerSkippedEvent) Type ¶
func (e *RunnerSkippedEvent) Type() string
type RunnerUnreachableEvent ¶
type RunnerUnreachableEvent struct {
// contains filtered or unexported fields
}
RunnerUnreachableEvent is raised when the target host is not reachable via SSH
func (*RunnerUnreachableEvent) Type ¶
func (e *RunnerUnreachableEvent) Type() string
type TaskStartEvent ¶
type TaskStartEvent struct {
// contains filtered or unexported fields
}
TaskStartEvent signals the beginning of a task
func (*TaskStartEvent) Type ¶
func (e *TaskStartEvent) Type() string