ansible

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ansible defines the RPC interface for the sansshell Ansible actions.

Index

Constants

This section is empty.

Variables

View Source
var File_ansible_proto protoreflect.FileDescriptor
View Source
var Playbook_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Ansible.Playbook",
	HandlerType: (*PlaybookServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Run",
			Handler:    _Playbook_Run_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ansible.proto",
}

Playbook_ServiceDesc is the grpc.ServiceDesc for Playbook service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPlaybookServer

func RegisterPlaybookServer(s grpc.ServiceRegistrar, srv PlaybookServer)

Types

type PlaybookClient

type PlaybookClient interface {
	// Will run ansible-playbook only on the local host using the args passed.
	Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunReply, error)
}

PlaybookClient is the client API for Playbook service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewPlaybookClient

func NewPlaybookClient(cc grpc.ClientConnInterface) PlaybookClient

type PlaybookClientProxy

type PlaybookClientProxy interface {
	PlaybookClient
	RunOneMany(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (<-chan *RunManyResponse, error)
}

PlaybookClientProxy is the superset of PlaybookClient which additionally includes the OneMany proxy methods

func NewPlaybookClientProxy

func NewPlaybookClientProxy(cc *proxy.Conn) PlaybookClientProxy

NewPlaybookClientProxy creates a PlaybookClientProxy for use in proxied connections. NOTE: This takes a proxy.Conn instead of a generic ClientConnInterface as the methods here are only valid in proxy.Conn contexts.

type PlaybookServer

type PlaybookServer interface {
	// Will run ansible-playbook only on the local host using the args passed.
	Run(context.Context, *RunRequest) (*RunReply, error)
}

PlaybookServer is the server API for Playbook service. All implementations should embed UnimplementedPlaybookServer for forward compatibility

type RunManyResponse

type RunManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *RunReply
	Error error
}

RunManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type RunReply

type RunReply struct {

	// All output sent to stdout.
	Stdout string `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"`
	// All output sent to stderr.
	Stderr string `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
	// The return code from the ansible command. Ansible returning non-zero will
	// not be an RPC failure as exec'ing is all we guarentee and some playbooks
	// are designed to return non-zero.
	ReturnCode int32 `protobuf:"varint,3,opt,name=return_code,json=returnCode,proto3" json:"return_code,omitempty"`
	// contains filtered or unexported fields
}

func (*RunReply) Descriptor deprecated

func (*RunReply) Descriptor() ([]byte, []int)

Deprecated: Use RunReply.ProtoReflect.Descriptor instead.

func (*RunReply) GetReturnCode

func (x *RunReply) GetReturnCode() int32

func (*RunReply) GetStderr

func (x *RunReply) GetStderr() string

func (*RunReply) GetStdout

func (x *RunReply) GetStdout() string

func (*RunReply) ProtoMessage

func (*RunReply) ProtoMessage()

func (*RunReply) ProtoReflect

func (x *RunReply) ProtoReflect() protoreflect.Message

func (*RunReply) Reset

func (x *RunReply) Reset()

func (*RunReply) String

func (x *RunReply) String() string

type RunRequest

type RunRequest struct {

	// The playbook to execute. Needs to be a fully qualified path.
	Playbook string `protobuf:"bytes,1,opt,name=playbook,proto3" json:"playbook,omitempty"`
	// Will become N -e options to ansible-playbook
	Vars []*Var `protobuf:"bytes,2,rep,name=vars,proto3" json:"vars,omitempty"`
	// The user to use for exection.
	User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"`
	// If set --check is passed to ansible. Depending on playbook settings
	// this may still execute tasks.
	Check bool `protobuf:"varint,4,opt,name=check,proto3" json:"check,omitempty"`
	// If set --diff is passed to ansible
	Diff bool `protobuf:"varint,5,opt,name=diff,proto3" json:"diff,omitempty"`
	// If true, execute ansible with verbose output enabled (equivilant to -vvv)
	Verbose bool `protobuf:"varint,6,opt,name=verbose,proto3" json:"verbose,omitempty"`
	// contains filtered or unexported fields
}

func (*RunRequest) Descriptor deprecated

func (*RunRequest) Descriptor() ([]byte, []int)

Deprecated: Use RunRequest.ProtoReflect.Descriptor instead.

func (*RunRequest) GetCheck

func (x *RunRequest) GetCheck() bool

func (*RunRequest) GetDiff

func (x *RunRequest) GetDiff() bool

func (*RunRequest) GetPlaybook

func (x *RunRequest) GetPlaybook() string

func (*RunRequest) GetUser

func (x *RunRequest) GetUser() string

func (*RunRequest) GetVars

func (x *RunRequest) GetVars() []*Var

func (*RunRequest) GetVerbose

func (x *RunRequest) GetVerbose() bool

func (*RunRequest) ProtoMessage

func (*RunRequest) ProtoMessage()

func (*RunRequest) ProtoReflect

func (x *RunRequest) ProtoReflect() protoreflect.Message

func (*RunRequest) Reset

func (x *RunRequest) Reset()

func (*RunRequest) String

func (x *RunRequest) String() string

type UnimplementedPlaybookServer

type UnimplementedPlaybookServer struct {
}

UnimplementedPlaybookServer should be embedded to have forward compatible implementations.

func (UnimplementedPlaybookServer) Run

type UnsafePlaybookServer

type UnsafePlaybookServer interface {
	// contains filtered or unexported methods
}

UnsafePlaybookServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PlaybookServer will result in compilation errors.

type Var

type Var struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Var) Descriptor deprecated

func (*Var) Descriptor() ([]byte, []int)

Deprecated: Use Var.ProtoReflect.Descriptor instead.

func (*Var) GetKey

func (x *Var) GetKey() string

func (*Var) GetValue

func (x *Var) GetValue() string

func (*Var) ProtoMessage

func (*Var) ProtoMessage()

func (*Var) ProtoReflect

func (x *Var) ProtoReflect() protoreflect.Message

func (*Var) Reset

func (x *Var) Reset()

func (*Var) String

func (x *Var) String() string

Directories

Path Synopsis
Package client provides the client interface for 'ansible'
Package client provides the client interface for 'ansible'
Package server implements the sansshell 'Ansible' service.
Package server implements the sansshell 'Ansible' service.

Jump to

Keyboard shortcuts

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