Documentation ¶
Index ¶
Constants ¶
const ( // AnsibleRolesPath is the key defined by the user AnsibleRolesPath = "ANSIBLE_ROLE_PATH" // AnsibleCollectionsPath is key defined by the user AnsibleCollectionsPath = "ANSIBLE_COLLECTION_PATH" // AnsibleInventoryPath is key defined by the user AnsibleInventoryPath = "ANSIBLE_INVENTORY" )
const ( // AnnotationKeyPolicyRun is the name of an annotation which instructs // the provider how to run the corresponding Ansible contents AnnotationKeyPolicyRun = "ansible.crossplane.io/runPolicy" )
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
func Diff(res *results.AnsiblePlaybookJSONResults) bool
Diff parses `ansible-runner --check` json output to determine whether there is a diff between the desired and the actual state of the configuration. It returns true if there is a diff.
func GetPolicyRun ¶
GetPolicyRun returns the ansible run policy annotation value on the resource.
func SetPolicyRun ¶
SetPolicyRun sets the ansible run policy annotation of the resource.
Types ¶
type Parameters ¶
type Parameters struct { // ansible-galaxy binary path. GalaxyBinary string // ansible-runner binary path. RunnerBinary string // WorkingDirPath in which to execute the ansible-runner binary. WorkingDirPath string CollectionsPath string // The source of this filed is either controller flag `--ansible-roles-path` or the env vars : `ANSIBLE_ROLES_PATH` , DEFAULT_ROLES_PATH` RolesPath string // the limit on the number of artifact directories to keep for each run ArtifactsHistoryLimit int }
Parameters are minimal needed Parameters to initializes ansible command(s)
func (Parameters) GalaxyInstall ¶
func (p Parameters) GalaxyInstall(ctx context.Context, behaviorVars map[string]string, requirementsType string) error
GalaxyInstall Install non-exists collections/roles with ansible-galaxy cli
type RunPolicy ¶
type RunPolicy struct {
Name string
}
RunPolicy represents the run policies of Ansible.
type Runner ¶
type Runner struct { Path string // absolute path on disk to a playbook or role depending on what cmdFunc expects AnsibleRunPolicy *RunPolicy // contains filtered or unexported fields }
Runner struct holds the configuration to run the cmdFunc
func (*Runner) EnableCheckMode ¶
EnableCheckMode enable the runner checkMode.
func (*Runner) GetAnsibleRunPolicy ¶
GetAnsibleRunPolicy to retrieve Ansible RunPolicy
func (*Runner) WriteExtraVar ¶
WriteExtraVar write extra var to env/extravars under working directory it creates a non-existent env/extravars file