ansible

package
v0.19.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright 2019 The Operator-SDK Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	RolesDir             = "roles"
	MoleculeDir          = "molecule"
	MoleculeDefaultDir   = MoleculeDir + filePathSep + "default"
	MoleculeTestLocalDir = MoleculeDir + filePathSep + "test-local"
	MoleculeClusterDir   = MoleculeDir + filePathSep + "cluster"
	MoleculeTemplatesDir = MoleculeDir + filePathSep + "templates"
)
View Source
const BuildDockerfileFile = "Dockerfile"
View Source
const DeployOperatorFile = "operator.yaml"
View Source
const GoModFile = "go.mod"
View Source
const MoleculeClusterConvergeFile = "converge.yml"
View Source
const MoleculeClusterCreateFile = "create.yml"
View Source
const MoleculeClusterDestroyFile = "destroy.yml"
View Source
const MoleculeClusterMoleculeFile = "molecule.yml"
View Source
const MoleculeClusterPrepareFile = "prepare.yml"
View Source
const MoleculeClusterVerifyFile = "verify.yml"
View Source
const MoleculeDefaultConvergeFile = "converge.yml"
View Source
const MoleculeDefaultMoleculeFile = "molecule.yml"
View Source
const MoleculeDefaultPrepareFile = "prepare.yml"
View Source
const MoleculeDefaultVerifyFile = "verify.yml"
View Source
const MoleculeTemplatesOperatorFile = "operator.yaml.j2"
View Source
const MoleculeTestLocalConvergeFile = "converge.yml"
View Source
const MoleculeTestLocalMoleculeFile = "molecule.yml"
View Source
const MoleculeTestLocalPrepareFile = "prepare.yml"
View Source
const MoleculeTestLocalVerifyFile = "verify.yml"
View Source
const PlaybookYamlFile = "playbook.yml"
View Source
const RolesDefaultsMainFile = "defaults" + filePathSep + "main.yml"
View Source
const RolesFilesDir = "files" + filePathSep + ".placeholder"
View Source
const RolesHandlersMainFile = "handlers" + filePathSep + "main.yml"
View Source
const RolesMetaMainFile = "meta" + filePathSep + "main.yml"
View Source
const RolesReadmeFile = "README.md"
View Source
const RolesTasksMainFile = "tasks" + filePathSep + "main.yml"
View Source
const RolesTemplatesDir = "templates" + filePathSep + ".placeholder"
View Source
const RolesVarsMainFile = "vars" + filePathSep + "main.yml"
View Source
const TravisFile = ".travis.yml"
View Source
const WatchesFile = "watches.yaml"

Variables

View Source
var AnsibleDelims = [2]string{"[[", "]]"}

AnsibleDelims is a slice of two strings representing the left and right delimiters for ansible templates. Arrays can't be constants but this should be a constant.

Functions

func PrintGoMod

func PrintGoMod() error

func UpdateAnsibleWatchForResource added in v0.18.0

func UpdateAnsibleWatchForResource(r *scaffold.Resource, absProjectPath string) error

TODO Extract adding watch resource into its own func. UpdateAnsibleWatchForResource checks for duplicate GVK, and appends to existing Watch.yaml file.

Types

type BuildDockerfile

type BuildDockerfile struct {
	input.Input
	RolesDir         string
	ImageTag         string
	GeneratePlaybook bool
}

func (*BuildDockerfile) GetInput

func (b *BuildDockerfile) GetInput() (input.Input, error)

GetInput - gets the input

type DeployOperator

type DeployOperator struct {
	input.Input
}

func (*DeployOperator) GetInput

func (d *DeployOperator) GetInput() (input.Input, error)

GetInput - gets the input

type DockerfileHybrid

type DockerfileHybrid struct {
	input.Input

	// Playbook - if true, include a COPY statement for playbook.yml
	Playbook bool

	// Roles - if true, include a COPY statement for the roles directory
	Roles bool

	// Watches - if true, include a COPY statement for watches.yaml
	Watches bool

	// Requirements - if true, include a COPY and RUN to install Ansible requirements
	Requirements bool
}

DockerfileHybrid - Dockerfile for a hybrid operator

func (*DockerfileHybrid) GetInput

func (d *DockerfileHybrid) GetInput() (input.Input, error)

GetInput - gets the input

type Entrypoint

type Entrypoint struct {
	StaticInput
}

Entrypoint - entrypoint script

func (*Entrypoint) GetInput

func (e *Entrypoint) GetInput() (input.Input, error)

type GoMod

type GoMod struct {
	input.Input
}

GoMod - the go.mod file for an Ansible hybrid operator.

func (*GoMod) GetInput

func (s *GoMod) GetInput() (input.Input, error)

type Main

type Main struct {
	StaticInput
}

Main - main source file for ansible operator

func (*Main) GetInput

func (m *Main) GetInput() (input.Input, error)

type MoleculeClusterConverge added in v0.17.0

type MoleculeClusterConverge struct {
	StaticInput
}

func (*MoleculeClusterConverge) GetInput added in v0.17.0

func (m *MoleculeClusterConverge) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeClusterCreate added in v0.16.0

type MoleculeClusterCreate struct {
	StaticInput
}

func (*MoleculeClusterCreate) GetInput added in v0.16.0

func (m *MoleculeClusterCreate) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeClusterDestroy added in v0.16.0

type MoleculeClusterDestroy struct {
	input.Input
	Resource scaffold.Resource
}

func (*MoleculeClusterDestroy) GetInput added in v0.16.0

func (m *MoleculeClusterDestroy) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeClusterMolecule added in v0.16.0

type MoleculeClusterMolecule struct {
	input.Input
	Resource scaffold.Resource
}

func (*MoleculeClusterMolecule) GetInput added in v0.16.0

func (m *MoleculeClusterMolecule) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeClusterPrepare added in v0.16.0

type MoleculeClusterPrepare struct {
	input.Input
	Resource scaffold.Resource
}

func (*MoleculeClusterPrepare) GetInput added in v0.16.0

func (m *MoleculeClusterPrepare) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeClusterVerify added in v0.16.0

type MoleculeClusterVerify struct {
	input.Input
	Resource scaffold.Resource
}

func (*MoleculeClusterVerify) GetInput added in v0.16.0

func (m *MoleculeClusterVerify) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeDefaultConverge added in v0.17.0

type MoleculeDefaultConverge struct {
	input.Input
	GeneratePlaybook bool
	Resource         scaffold.Resource
}

func (*MoleculeDefaultConverge) GetInput added in v0.17.0

func (m *MoleculeDefaultConverge) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeDefaultMolecule

type MoleculeDefaultMolecule struct {
	StaticInput
}

func (*MoleculeDefaultMolecule) GetInput

func (m *MoleculeDefaultMolecule) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeDefaultPrepare

type MoleculeDefaultPrepare struct {
	StaticInput
}

func (*MoleculeDefaultPrepare) GetInput

func (m *MoleculeDefaultPrepare) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeDefaultVerify added in v0.16.0

type MoleculeDefaultVerify struct {
	StaticInput
}

func (*MoleculeDefaultVerify) GetInput added in v0.16.0

func (m *MoleculeDefaultVerify) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeTemplatesOperator added in v0.16.0

type MoleculeTemplatesOperator struct {
	input.Input
}

func (*MoleculeTemplatesOperator) GetInput added in v0.16.0

func (m *MoleculeTemplatesOperator) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeTestLocalConverge added in v0.17.0

type MoleculeTestLocalConverge struct {
	input.Input
	Resource scaffold.Resource
}

func (*MoleculeTestLocalConverge) GetInput added in v0.17.0

func (m *MoleculeTestLocalConverge) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeTestLocalMolecule

type MoleculeTestLocalMolecule struct {
	StaticInput
}

func (*MoleculeTestLocalMolecule) GetInput

func (m *MoleculeTestLocalMolecule) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeTestLocalPrepare

type MoleculeTestLocalPrepare struct {
	StaticInput
}

func (*MoleculeTestLocalPrepare) GetInput

func (m *MoleculeTestLocalPrepare) GetInput() (input.Input, error)

GetInput - gets the input

type MoleculeTestLocalVerify added in v0.16.0

type MoleculeTestLocalVerify struct {
	StaticInput
}

func (*MoleculeTestLocalVerify) GetInput added in v0.16.0

func (m *MoleculeTestLocalVerify) GetInput() (input.Input, error)

GetInput - gets the input

type Playbook

type Playbook struct {
	input.Input
	Resource scaffold.Resource
}

Playbook - the playbook tmpl wrapper

func (*Playbook) GetInput

func (p *Playbook) GetInput() (input.Input, error)

GetInput - gets the input

type RequirementsYml added in v0.16.0

type RequirementsYml struct {
	StaticInput
}

RequirementsYml - A requirements file for Ansible collection dependencies

func (*RequirementsYml) GetInput added in v0.16.0

func (r *RequirementsYml) GetInput() (input.Input, error)

GetInput - gets the input

type RolesDefaultsMain

type RolesDefaultsMain struct {
	input.Input
	Resource scaffold.Resource
}

func (*RolesDefaultsMain) GetInput

func (r *RolesDefaultsMain) GetInput() (input.Input, error)

GetInput - gets the input

type RolesFiles

type RolesFiles struct {
	StaticInput
	Resource scaffold.Resource
}

func (*RolesFiles) GetInput

func (r *RolesFiles) GetInput() (input.Input, error)

GetInput - gets the input

type RolesHandlersMain

type RolesHandlersMain struct {
	input.Input
	Resource scaffold.Resource
}

func (*RolesHandlersMain) GetInput

func (r *RolesHandlersMain) GetInput() (input.Input, error)

GetInput - gets the input

type RolesMetaMain

type RolesMetaMain struct {
	StaticInput
	Resource scaffold.Resource
}

func (*RolesMetaMain) GetInput

func (r *RolesMetaMain) GetInput() (input.Input, error)

GetInput - gets the input

type RolesReadme

type RolesReadme struct {
	StaticInput
	Resource scaffold.Resource
}

func (*RolesReadme) GetInput

func (r *RolesReadme) GetInput() (input.Input, error)

GetInput - gets the input

type RolesTasksMain

type RolesTasksMain struct {
	input.Input
	Resource scaffold.Resource
}

func (*RolesTasksMain) GetInput

func (r *RolesTasksMain) GetInput() (input.Input, error)

GetInput - gets the input

type RolesTemplates

type RolesTemplates struct {
	StaticInput
	Resource scaffold.Resource
}

func (*RolesTemplates) GetInput

func (r *RolesTemplates) GetInput() (input.Input, error)

GetInput - gets the input

type RolesVarsMain

type RolesVarsMain struct {
	input.Input
	Resource scaffold.Resource
}

func (*RolesVarsMain) GetInput

func (r *RolesVarsMain) GetInput() (input.Input, error)

GetInput - gets the input

type StaticInput

type StaticInput struct {
	input.Input
}

StaticInput is the input for scaffolding a static file with no parameters

func (*StaticInput) CustomRender

func (s *StaticInput) CustomRender() ([]byte, error)

CustomRender return the template body unmodified

func (StaticInput) SetFS

func (s StaticInput) SetFS(_ afero.Fs)

type Travis

type Travis struct {
	StaticInput
}

func (*Travis) GetInput

func (t *Travis) GetInput() (input.Input, error)

GetInput - gets the input

type UserSetup

type UserSetup struct {
	StaticInput
}

UserSetup - userSetup script

func (*UserSetup) GetInput

func (u *UserSetup) GetInput() (input.Input, error)

type Watches

type Watches struct {
	input.Input
	GeneratePlaybook bool
	RolesDir         string
	Resource         scaffold.Resource
}

func (*Watches) GetInput

func (w *Watches) GetInput() (input.Input, error)

GetInput - gets the input

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL