From 6689e78244175617b417f97db21cc901d347412d Mon Sep 17 00:00:00 2001 From: Simon Baerlocher Date: Thu, 9 Nov 2023 21:54:43 +0100 Subject: [PATCH 1/3] feat(variable): Add 'GalaxyForce' booleant --- .all-contributorsrc | 2 +- .editorconfig | 20 ++++++++++++++++++++ .pre-commit-config.yaml | 6 ++++++ main.go | 6 ++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 .pre-commit-config.yaml diff --git a/.all-contributorsrc b/.all-contributorsrc index 9c86013..c53b86d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -16,7 +16,7 @@ "avatar_url": "https://avatars1.githubusercontent.com/u/4160387?v=4", "profile": "https://sbaerlocher.ch", "contributions": [ - "code", + "code", "ideas" ] } diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..26888c9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# Top-most EditorConfig file +root = true + +# Default settings for all files +[*] +charset = utf-8 # Set the character encoding to UTF-8 +end_of_line = lf # Use Line Feed for new lines +indent_size = 4 # Set the indent size to 4 spaces +indent_style = space # Use spaces for indentation +insert_final_newline = true # Ensure file ends with a newline +trim_trailing_whitespace = true # Remove any whitespace at the end of a line +[{Makefile,go.mod,go.sum,*.go,.gitmodules}] +indent_style = tab +indent_size = 4 + +[*.md] +indent_size = 4 +trim_trailing_whitespace = false + +eclint_indent_style = unset diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e80be97 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer diff --git a/main.go b/main.go index 39888ff..89591aa 100644 --- a/main.go +++ b/main.go @@ -36,6 +36,11 @@ func main() { Usage: "path to galaxy requirements", EnvVars: []string{"ANSIBLE_GALAXY_FILE", "INPUT_GALAXY_FILE", "PLUGIN_GALAXY_FILE"}, }, + &cli.StringFlag{ + Name: "galaxy-force", + Usage: "galaxy force", + EnvVars: []string{"ANSIBLE_GALAXY_FORCE", "INPUT_GALAXY_FORCE", "PLUGIN_GALAXY_FORCE"}, + }, &cli.StringSliceFlag{ Name: "inventory,i", Usage: "specify inventory host path", @@ -206,6 +211,7 @@ func run(c *cli.Context) error { playbook := &ansible.AnsiblePlaybook{ Config: ansible.Config{ GalaxyFile: c.String("galaxy-file"), + GalaxyForce c.Bool("galaxy-force"), Inventories: c.StringSlice("inventory"), Playbooks: c.StringSlice("playbook"), Limit: c.String("limit"), From 252dc91188c55866d071d19111aa45853a1c99d1 Mon Sep 17 00:00:00 2001 From: Simon Baerlocher Date: Thu, 9 Nov 2023 21:56:49 +0100 Subject: [PATCH 2/3] docs(changelog): Update changelog for GalaxyForce boolean variable --- CHANGELOG.md | 6 ++++++ main.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4347724..8e0b651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ and [human-readable changelog](https://keepachangelog.com/en/1.0.0/). ## master +## 0.0.8 + +### Changed + +- feat(variable): Add 'GalaxyForce' booleant + ## 0.0.7 ### Changed diff --git a/main.go b/main.go index 89591aa..f78ba43 100644 --- a/main.go +++ b/main.go @@ -211,7 +211,7 @@ func run(c *cli.Context) error { playbook := &ansible.AnsiblePlaybook{ Config: ansible.Config{ GalaxyFile: c.String("galaxy-file"), - GalaxyForce c.Bool("galaxy-force"), + GalaxyForce: c.Bool("galaxy-force"), Inventories: c.StringSlice("inventory"), Playbooks: c.StringSlice("playbook"), Limit: c.String("limit"), From 928eef471e51d069523a178397206fca6f59a8c8 Mon Sep 17 00:00:00 2001 From: Simon Baerlocher Date: Thu, 9 Nov 2023 22:15:58 +0100 Subject: [PATCH 3/3] fix(ansiblePlaybook): resolve 'config' reference to use proper 'Config' field --- go.mod | 4 ++-- go.sum | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index f5ea028..b5780cd 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ -module github.com/sbaerlocher/go-test +module github.com/arillso/action.playbook go 1.18 require ( - github.com/arillso/go.ansible v0.0.2 + github.com/arillso/go.ansible v0.0.4 github.com/joho/godotenv v1.5.1 github.com/urfave/cli/v2 v2.25.7 ) diff --git a/go.sum b/go.sum index 101f39e..db21abc 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,5 @@ -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/arillso/go.ansible v0.0.2 h1:q7eyYvSEYClXE5/dYNntF38TmuGAn2y2tfToFnpjLK0= -github.com/arillso/go.ansible v0.0.2/go.mod h1:fQ/pnEpbx8qb6TGoleujEYHOEtbw1d36g8MV/rdK0WM= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/arillso/go.ansible v0.0.4 h1:NG20Pohtejs7xyTJeAAmWJUXirsk67BLRYE5IvXaUBY= +github.com/arillso/go.ansible v0.0.4/go.mod h1:4xsAZCWUsdoLtOnA4BLoqd+vLD82qqqCZTxDm+c1oP8= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= @@ -15,5 +12,3 @@ github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=