Documentation ¶
Overview ¶
Package ansible defines the RPC interface for the sansshell Ansible actions.
Index ¶
- Variables
- func RegisterPlaybookServer(s grpc.ServiceRegistrar, srv PlaybookServer)
- type PlaybookClient
- type PlaybookClientProxy
- type PlaybookServer
- type RunManyResponse
- type RunReply
- func (*RunReply) Descriptor() ([]byte, []int)deprecated
- func (x *RunReply) GetReturnCode() int32
- func (x *RunReply) GetStderr() string
- func (x *RunReply) GetStdout() string
- func (*RunReply) ProtoMessage()
- func (x *RunReply) ProtoReflect() protoreflect.Message
- func (x *RunReply) Reset()
- func (x *RunReply) String() string
- type RunRequest
- func (*RunRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RunRequest) GetCheck() bool
- func (x *RunRequest) GetDiff() bool
- func (x *RunRequest) GetPlaybook() string
- func (x *RunRequest) GetUser() string
- func (x *RunRequest) GetVars() []*Var
- func (x *RunRequest) GetVerbose() bool
- func (*RunRequest) ProtoMessage()
- func (x *RunRequest) ProtoReflect() protoreflect.Message
- func (x *RunRequest) Reset()
- func (x *RunRequest) String() string
- type UnimplementedPlaybookServer
- type UnsafePlaybookServer
- type Var
Constants ¶
This section is empty.
Variables ¶
var File_ansible_proto protoreflect.FileDescriptor
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) GetReturnCode ¶
func (*RunReply) ProtoMessage ¶
func (*RunReply) ProtoMessage()
func (*RunReply) ProtoReflect ¶
func (x *RunReply) ProtoReflect() protoreflect.Message
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 ¶
func (UnimplementedPlaybookServer) Run(context.Context, *RunRequest) (*RunReply, error)
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) ProtoMessage ¶
func (*Var) ProtoMessage()
func (*Var) ProtoReflect ¶
func (x *Var) ProtoReflect() protoreflect.Message