Documentation
¶
Index ¶
- Constants
- func WithJSONLEventTransformers(trans ...transformer.TransformerFunc) result.OptionsFunc
- func WithTransformers(trans ...transformer.TransformerFunc) result.OptionsFunc
- type AnsiblePlaybookJSONLEventResults
- type AnsiblePlaybookJSONResults
- type AnsiblePlaybookJSONResultsPlay
- type AnsiblePlaybookJSONResultsPlayDuration
- type AnsiblePlaybookJSONResultsPlayTask
- type AnsiblePlaybookJSONResultsPlayTaskHostsItem
- type AnsiblePlaybookJSONResultsPlayTaskItem
- type AnsiblePlaybookJSONResultsPlayTaskItemDuration
- type AnsiblePlaybookJSONResultsPlaysPlay
- type AnsiblePlaybookJSONResultsStats
- type JSONLEventStdoutCallbackResults
- type JSONStdoutCallbackResults
Constants ¶
const (
// PrefixTokenSeparator is and string printed between prefix and ansible output
PrefixTokenSeparator = "\u2500\u2500"
)
Variables ¶
This section is empty.
Functions ¶
func WithJSONLEventTransformers ¶ added in v2.2.0
func WithJSONLEventTransformers(trans ...transformer.TransformerFunc) result.OptionsFunc
WithJSONLEventTransformers sets a transformers list to JSONLEventStdoutCallbackResults
func WithTransformers ¶
func WithTransformers(trans ...transformer.TransformerFunc) result.OptionsFunc
WithTransformers sets a transformers list to DefaultResults
Types ¶
type AnsiblePlaybookJSONLEventResults ¶ added in v2.2.0
type AnsiblePlaybookJSONLEventResults struct { Event string `json:"_event"` Timestamp string `json:"_timestamp"` CustomStats interface{} `json:"custom_stats"` GlobalCustomStats interface{} `json:"global_custom_stats"` Hosts map[string]*AnsiblePlaybookJSONResultsPlayTaskHostsItem `json:"hosts,omitempty"` Play *AnsiblePlaybookJSONResultsPlaysPlay `json:"play,omitempty"` Stats map[string]*AnsiblePlaybookJSONResultsStats `json:"stats"` Task *AnsiblePlaybookJSONResultsPlayTaskItem `json:"task,omitempty"` Tasks []AnsiblePlaybookJSONResultsPlayTask `json:"tasks,omitempty"` }
AnsiblePlaybookJSONLEventResults represents the structure of the JSON lines generated by an Ansible playbook execution using the ansible.posix.jsonl callback plugin
func (AnsiblePlaybookJSONLEventResults) String ¶ added in v2.2.0
func (a AnsiblePlaybookJSONLEventResults) String() string
String returns a string representation of AnsiblePlaybookJSONLEventResults
type AnsiblePlaybookJSONResults ¶
type AnsiblePlaybookJSONResults struct { Playbook string `json:"-"` CustomStats interface{} `json:"custom_stats"` GlobalCustomStats interface{} `json:"global_custom_stats"` Plays []AnsiblePlaybookJSONResultsPlay `json:"plays"` Stats map[string]*AnsiblePlaybookJSONResultsStats `json:"stats"` }
AnsiblePlaybookJSONResults represents the structure of the JSON generated by an Ansible playbook execution using the JSON callback plugin
func JSONParse ¶
func JSONParse(data []byte) (*AnsiblePlaybookJSONResults, error)
JSONParse return an AnsiblePlaybookJSONResults from a JSON data
func ParseJSONResultsStream ¶
func ParseJSONResultsStream(stream io.Reader) (*AnsiblePlaybookJSONResults, error)
ParseJSONResultsStream parse the ansible' JSON stdout callback and return an AnsiblePlaybookJSONResults
func (*AnsiblePlaybookJSONResults) CheckStats ¶
func (r *AnsiblePlaybookJSONResults) CheckStats() error
CheckStats return error when is found a failure or unreachable host
func (*AnsiblePlaybookJSONResults) String ¶
func (r *AnsiblePlaybookJSONResults) String() string
String return a string representation of the AnsiblePlaybookJSONResults
type AnsiblePlaybookJSONResultsPlay ¶
type AnsiblePlaybookJSONResultsPlay struct { Play *AnsiblePlaybookJSONResultsPlaysPlay `json:"play"` Tasks []AnsiblePlaybookJSONResultsPlayTask `json:"tasks"` }
AnsiblePlaybookJSONResultsPlay represents the structure of the JSON generated by an Ansible playbook execution using the JSON callback plugin
https://github.com/ansible-collections/ansible.posix/blob/main/plugins/callback/json.py#L80
{ 'play': { 'name': play.get_name(), 'id': to_text(play._uuid), 'path': to_text(play.get_path()), 'duration': { 'start': current_time() } }, 'tasks': [] }
type AnsiblePlaybookJSONResultsPlayDuration ¶
type AnsiblePlaybookJSONResultsPlayDuration struct { Start string `json:"start"` End string `json:"end"` }
AnsiblePlaybookJSONResultsPlayDuration represents the structure of the JSON generated by an Ansible playbook execution using the JSON callback plugin
func (*AnsiblePlaybookJSONResultsPlayDuration) String ¶ added in v2.2.0
func (d *AnsiblePlaybookJSONResultsPlayDuration) String() string
String return a string representation of the AnsiblePlaybookJSONResultsPlayDuration
type AnsiblePlaybookJSONResultsPlayTask ¶
type AnsiblePlaybookJSONResultsPlayTask struct { Hosts map[string]*AnsiblePlaybookJSONResultsPlayTaskHostsItem `json:"hosts"` Task *AnsiblePlaybookJSONResultsPlayTaskItem `json:"task"` }
AnsiblePlaybookJSONResultsPlayTask represents the structure of the JSON generated by an Ansible playbook execution using the JSON callback plugin.
For more details, see: https://github.com/ansible-collections/ansible.posix/blob/main/plugins/callback/json.py#L94
{ 'task': { 'name': task.get_name(), 'id': to_text(task._uuid), 'path': to_text(task.get_path()), 'duration': { 'start': current_time() } }, 'hosts': {} }
type AnsiblePlaybookJSONResultsPlayTaskHostsItem ¶
type AnsiblePlaybookJSONResultsPlayTaskHostsItem struct { Action string `json:"action"` Changed bool `json:"changed"` Msg interface{} `json:"msg"` AnsibleFacts map[string]interface{} `json:"ansible_facts"` Stdout interface{} `json:"stdout"` StdoutLines []interface{} `json:"stdout_lines"` Stderr interface{} `json:"stderr"` StderrLines []interface{} `json:"stderr_lines"` Cmd interface{} `json:"cmd"` Failed bool `json:"failed"` FailedWhenResult bool `json:"failed_when_result"` Skipped bool `json:"skipped"` SkipReason string `json:"skip_reason"` Unreachable bool `json:"unreachable"` }
AnsiblePlaybookJSONResultsPlayTaskHostsItem represents the structure of the JSON generated by an Ansible playbook execution using the JSON callback plugin
type AnsiblePlaybookJSONResultsPlayTaskItem ¶
type AnsiblePlaybookJSONResultsPlayTaskItem struct { Duration *AnsiblePlaybookJSONResultsPlayTaskItemDuration `json:"duration"` Id string `json:"id"` Name string `json:"name"` Path string `json:"path"` }
AnsiblePlaybookJSONResultsPlayTaskItem represents the structure of the JSON generated by an Ansible playbook execution using the JSON callback plugin
type AnsiblePlaybookJSONResultsPlayTaskItemDuration ¶
type AnsiblePlaybookJSONResultsPlayTaskItemDuration struct { Start string `json:"start"` End string `json:"end"` }
AnsiblePlaybookJSONResultsPlayTaskItemDuration represents the structure of the JSON generated by an Ansible playbook execution using the JSON callback plugin
func (*AnsiblePlaybookJSONResultsPlayTaskItemDuration) String ¶ added in v2.2.0
func (t *AnsiblePlaybookJSONResultsPlayTaskItemDuration) String() string
String return a string representation of the AnsiblePlaybookJSONResultsPlayTaskItem
type AnsiblePlaybookJSONResultsPlaysPlay ¶
type AnsiblePlaybookJSONResultsPlaysPlay struct { Duration *AnsiblePlaybookJSONResultsPlayDuration `json:"duration"` Id string `json:"id"` Name string `json:"name"` Path string `json:"path"` }
AnsiblePlaybookJSONResultsPlaysPlay represents the structure of the JSON generated by an Ansible playbook execution using the JSON callback plugin
type AnsiblePlaybookJSONResultsStats ¶
type AnsiblePlaybookJSONResultsStats struct { Changed int `json:"changed"` Failures int `json:"failures"` Ignored int `json:"ignored"` Ok int `json:"ok"` Rescued int `json:"rescued"` Skipped int `json:"skipped"` Unreachable int `json:"unreachable"` }
AnsiblePlaybookJSONResultsStats represents the structure of the JSON generated by an Ansible playbook execution using the JSON callback plugin
func (*AnsiblePlaybookJSONResultsStats) String ¶
func (s *AnsiblePlaybookJSONResultsStats) String() string
String return a string representation of the AnsiblePlaybookJSONResultsStats
type JSONLEventStdoutCallbackResults ¶ added in v2.2.0
type JSONLEventStdoutCallbackResults struct {
// contains filtered or unexported fields
}
JSONLEventStdoutCallbackResults handles the ansible.posix.jsonl callback plugin output
func NewJSONLEventStdoutCallbackResults ¶ added in v2.2.0
func NewJSONLEventStdoutCallbackResults(options ...result.OptionsFunc) *JSONLEventStdoutCallbackResults
NewJSONLEventStdoutCallbackResults creates a new JSONLEventStdoutCallbackResults instance
func (*JSONLEventStdoutCallbackResults) Options ¶ added in v2.2.0
func (r *JSONLEventStdoutCallbackResults) Options(options ...result.OptionsFunc)
Options executes the options functions received as a parameters to set the JSONLEventStdoutCallbackResults attributes
type JSONStdoutCallbackResults ¶
type JSONStdoutCallbackResults struct {
// contains filtered or unexported fields
}
func NewJSONStdoutCallbackResults ¶
func NewJSONStdoutCallbackResults(options ...result.OptionsFunc) *JSONStdoutCallbackResults
func (*JSONStdoutCallbackResults) Options ¶
func (r *JSONStdoutCallbackResults) Options(options ...result.OptionsFunc)
Options executes the options functions received as a parameters to set the DefaultResults attributes