Documentation ¶
Overview ¶
Package config implements the playbook config format
Package config implements the playbook config format ¶
Package config implements the playbook config format ¶
Package config implements the playbook config format
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseConfig ¶
type BaseConfig struct {
Plays []*BasePlay `json:"plays"`
}
BaseConfig holds a list of plays but only the Name and Groups field are decoded
func NewBaseConfigFromFile ¶
func NewBaseConfigFromFile(path string) (*BaseConfig, error)
NewBaseConfigFromFile loads a playbook base config from the given file path. The file must contain yaml data.
func NewBaseConfigFromReader ¶
func NewBaseConfigFromReader(reader io.Reader) (*BaseConfig, error)
NewBaseConfigFromReader loads a playbook base config from the given bufio.Reader. The reader must point to yaml data.
func (*BaseConfig) Applicable ¶
func (bc *BaseConfig) Applicable(groups []string) (*BaseConfig, error)
Applicable returns a BaseConfig that contains only the plays where the groups value of the play matches the groups given as parameter
func (*BaseConfig) ApplicableMap ¶
func (bc *BaseConfig) ApplicableMap(groups []string) (*map[string]interface{}, error)
ApplicableMap returns a map of the BaseConfig that contains only the plays where the groups value of the play matches the groups given as parameter
type BasePlay ¶
type BasePlay struct { Name string `json:"name"` Groups []string `json:"groups"` Charts *json.RawMessage `json:"charts,omitempty"` Repos *json.RawMessage `json:"repos,omitempty"` }
BasePlay holds the same information as a play, but only the Name and the Groups are decoded Used to select the plays relevant for a given target and to delay decoding of the remaining play data
type Chart ¶
type Chart struct { Name string `json:"name"` Repo string `json:"repo"` Chart string `json:"chart"` Version string `json:"version"` Namespace string `json:"namespace"` Values map[string]interface{} `json:"values"` }
Chart holds all information to deploy a helm chart
type Config ¶
type Config struct {
Plays []*Play `json:"plays"`
}
Config holds a list of plays
func NewConfigFromMap ¶
NewConfigFromMap takes raw config data and parses it into an inventory config
type Pattern ¶
type Pattern struct {
// contains filtered or unexported fields
}
A Pattern is based on the idea of patterns in Ansible: https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html Each pattern is regexp that is implicitely enclosed in ^$ and has an optional modifier prefix.
func NewPattern ¶
NewPattern returns a new pattern based on the given expression string and a list of groups. If the first charactor of the expression is either ! or &, it will be treated as modifier and the rest is treated as a regexp that will be wrapped in ^$. If no modifier is present, the whole expression will be treated as a ^$ wrapped regexp. The regexp is then matched against the list of groups and all matching groups will be stored in its internal groups field wich will be used by the Matches() method to determinee if the pattern matches the given groups.
type Play ¶
type Play struct { Name string `json:"name"` Groups []string `json:"groups"` Charts []*Chart `json:"charts"` Repos []*Repo `json:"repos"` }
Play defines which charts are deployed from which repositories to which targets
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is used to determin if a list of Patterns added via the Add() method is valid.