Releases: apenella/go-ansible
Releases · apenella/go-ansible
v1.1.7
v1.1.6
v1.1.6
Fixed
- Quote
Args
value onAnsibleAdhocCmd
'sString
method #91 - On default executor, set all parent process environment variables to
cmd.Env
when a custom env vars is defined #94 - Fix parsing of long lines in output #101
Added
ExecutorTimeMeasurement
is a decorator defined ongithub.com/apenella/go-ansible/pkg/execute
, that measures the duration of an execution, it receives anExecutor
which is measured the execution time #92- Add
unreachable
state on task play results structAnsiblePlaybookJSONResultsPlayTaskHostsItem
#100
Chanded
MockExecute
usesgithub.com/stretchr/testify/mock
#92- Examples' name are prefixed by
ansibleplaybook
oransibleadhoc
Removed
DefaultExecutor
does not measures the execution duration anymore. Instead of it,ExecutorTimeMeasurement
must be used #92
v1.1.5
v1.1.5
Added
- New function
WithEnvVar
ongithub.com/apenella/go-ansible/pkg/execute
package that adds environment variables toDefaultExecutor
command.
Fixed
- Include missing attributes on
AnsiblePlaybookJSONResultsPlayTaskHostsItem
. Those attributes arecmd
,skipped
,skip_reason
,failed
, andfailed_when_result
v1.1.4
v1.1.4
Added
- New function
ParseJSONResultsStream
on"github.com/apenella/go-ansible/pkg/stdoutcallback/results"
that allow to parse ansible stdout json output as a stream. That method supports to parse json output when multiple playbooks are executed.
v1.1.3
v1.1.3
Fixed
- New attribute
ExtraVarsFile
onAnsiblePlaybookOptions
that allows to use YAML/JSON files to define extra-vars - New attribute
ExtraVarsFile
onAnsibleAdhocOptions
that allows to use YAML/JSON files to define extra-vars
v1.1.2
v1.1.2
Fixed
- Include
stdout
andstdout_lines
toAnsiblePlaybookJSONResultsPlayTaskHostsItem
- Include
stderr
andstderr_lines
toAnsiblePlaybookJSONResultsPlayTaskHostsItem
v1.1.1
[v1.1.1]
Changed
- update dependency package github.com/apenella/go-common-utils/error
- update dependency package github.com/apenella/go-common-utils/data
Fixed
v1.1.0
[v1.1.0]
Added
- support for stdin on
DefaultExecute
Execute method
v1.0.0
[v1.0.0]
Added
- Included
ansible-playbook
version2.10.6
options onAnsiblePlaybookOptions
- Included
github.com/apenella/go-ansible/pkg/adhoc
package to interact toansible
adhoc command - New function type
ExecuteOptions
to provide options to executor instances - New
DefaultExecute
constructorNewDefaultExecute
that accepts a list ofExecuteOptions
- New component to customize ansible output lines. That component is named transformer
- Include a bunch of transformers that can be already used:
- Prepend(string): Prepends and string to the output line
- Append(string): Appends and string to the output line
- LogFormat(string): Prepends date time to the output line
- IgnoreMessage([]string): Ignores the output lines based on input strings
- New private method
output
onresults
package to manage how to write the output lines and that can be used by anyStdoutCallbackResultsFunc
Changed
- BREAKING CHANGE:
ansibler
has been restructured and splitted to multiple packages:- Type
AnsiblePlaybookConnectionOptions
is renamed toAnsibleConnectionOptions
and placed togithub.com/apenella/go-ansible/pkg/options
- Type
AnsiblePlaybookPrivilegeEscalationOptions
is renamed toAnsiblePrivilegeEscalationOptions
and placed togithub.com/apenella/go-ansible/pkg/options
- All constants regarding connection options and privileged escalations options has been placed to
github.com/apenella/go-ansible/pkg/options
AnsiblePlaybookCmd
andAnsiblePlaybookOptions
has been placed togithub.com/apenella/go-ansible/pkg/playbook
- All constants regarding ansible-playbook command interaction has been placed to
github.com/apenella/go-ansible/pkg/playbook
- Type
- BREAKING CHANGE:
Playbook
attribute onAnsiblePlaybookCmd
has been replaced toPlaybooks
attribut which accept multiple playbooks to be run - BREAKING CHANGE:
Executor
interface has been moved fromansibler
package togithub.com/apenella/go-ansible/pkg/execute
package - BREAKING CHANGE:
Executor
interface is changed toExecute(ctx context.Context, command []string, resultsFunc stdoutcallback.StdoutCallbackResultsFunc, options ...ExecuteOptions) error
- BREAKING CHANGE:
DefaultExecute
has been updated to use options pattern design, and includes a bunch ofWithXXX
methods to set its attributes - BREAKING CHANGE:
StdoutCallbackResultsFunc
signature has been updated tofunc(context.Context, io.Reader, io.Writer, ...results.TransformerFunc) error
. Prefix argument has been removed and a list of transformers could be passed to the function DefaultStdoutCallbackResults
andJSONStdoutCallbackResults
prepares default transformers for default output an callsoutput
, instead of managing the output by its own
Removed
- BREAKING CHANGE: Remove
ExecPrefix
fromAnsiblePlaybookCmd
- BREAKING CHANGE: Remove
CmdRunDir
fromAnsiblePlaybookCmd
- BREAKING CHANGE: Remove
Writer
fromAnsiblePlaybookCmd
- BREAKING CHANGE: Remove
ResultsFunc
fromDefaultExecute
- BREAKING CHANGE: Remove
Prefix
fromDefaultExecute
. Prefix is not manatory any more and could be added using thePrepend
transformer. skipLine
method has been removed. Replaced byIgnoreMessage
transformer
v0.8.0
Changelog
- Include attribute CmdRunDir on AnsiblePlaybookCmd which defines the playbook run directory
- Include attribute CmdRunDir on DefaultExecutor