From 64f19c0dc3925a967345802a05771459233cd6ec Mon Sep 17 00:00:00 2001 From: Petr Artamonov Date: Thu, 7 Jan 2016 18:13:30 +0100 Subject: [PATCH 1/4] enable reporting flag --- builtin/provisioners/chef/resource_provisioner.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/provisioners/chef/resource_provisioner.go b/builtin/provisioners/chef/resource_provisioner.go index 68ae6256a..14b57a3e2 100644 --- a/builtin/provisioners/chef/resource_provisioner.go +++ b/builtin/provisioners/chef/resource_provisioner.go @@ -62,6 +62,8 @@ ENV['HTTPS_PROXY'] = "{{ .HTTPSProxy }}" {{ if .NOProxy }}no_proxy "{{ join .NOProxy "," }}"{{ end }} {{ if .SSLVerifyMode }}ssl_verify_mode {{ .SSLVerifyMode }}{{ end }} + +{{ if .EnableReporting }}enable_reporting {{ .EnableReporting }}{{ end }} ` // Provisioner represents a specificly configured chef provisioner @@ -84,6 +86,7 @@ type Provisioner struct { ServerURL string `mapstructure:"server_url"` SkipInstall bool `mapstructure:"skip_install"` SSLVerifyMode string `mapstructure:"ssl_verify_mode"` + EnableReporting string `mapstructure:"enable_reporting"` ValidationClientName string `mapstructure:"validation_client_name"` ValidationKey string `mapstructure:"validation_key"` Version string `mapstructure:"version"` From 063abc866ca208a03825b8d2674f132695984fe0 Mon Sep 17 00:00:00 2001 From: Petr Artamonov Date: Fri, 8 Jan 2016 12:23:01 +0100 Subject: [PATCH 2/4] docs updated --- website/source/docs/provisioners/chef.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/source/docs/provisioners/chef.html.markdown b/website/source/docs/provisioners/chef.html.markdown index 60f6d577a..27285e657 100644 --- a/website/source/docs/provisioners/chef.html.markdown +++ b/website/source/docs/provisioners/chef.html.markdown @@ -98,6 +98,9 @@ The following arguments are supported: * `ssl_verify_mode (string)` - (Optional) Use to set the verify mode for Chef Client HTTPS requests. +* `enable_reporting (string)` - (Optional) Cause the chef-client to send data to the Chef + server for use with Chef reporting, if flag is omitted default value is `true` + * `validation_client_name (string)` - (Required) The name of the validation client to use for the initial communication with the Chef Server. From 76913703a9245a2be23580debde7a8fb3c197cd6 Mon Sep 17 00:00:00 2001 From: Petr Artamonov Date: Fri, 8 Jan 2016 20:00:11 +0100 Subject: [PATCH 3/4] modified to have less code and not to verify incoming string --- builtin/provisioners/chef/resource_provisioner.go | 4 ++-- website/source/docs/provisioners/chef.html.markdown | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/builtin/provisioners/chef/resource_provisioner.go b/builtin/provisioners/chef/resource_provisioner.go index 14b57a3e2..b44118a44 100644 --- a/builtin/provisioners/chef/resource_provisioner.go +++ b/builtin/provisioners/chef/resource_provisioner.go @@ -63,7 +63,7 @@ ENV['HTTPS_PROXY'] = "{{ .HTTPSProxy }}" {{ if .NOProxy }}no_proxy "{{ join .NOProxy "," }}"{{ end }} {{ if .SSLVerifyMode }}ssl_verify_mode {{ .SSLVerifyMode }}{{ end }} -{{ if .EnableReporting }}enable_reporting {{ .EnableReporting }}{{ end }} +{{ if .DisableReporting }}enable_reporting false{{ end }} ` // Provisioner represents a specificly configured chef provisioner @@ -86,7 +86,7 @@ type Provisioner struct { ServerURL string `mapstructure:"server_url"` SkipInstall bool `mapstructure:"skip_install"` SSLVerifyMode string `mapstructure:"ssl_verify_mode"` - EnableReporting string `mapstructure:"enable_reporting"` + DisableReporting bool `mapstructure:"disable_reporting"` ValidationClientName string `mapstructure:"validation_client_name"` ValidationKey string `mapstructure:"validation_key"` Version string `mapstructure:"version"` diff --git a/website/source/docs/provisioners/chef.html.markdown b/website/source/docs/provisioners/chef.html.markdown index 27285e657..e61d7bc0b 100644 --- a/website/source/docs/provisioners/chef.html.markdown +++ b/website/source/docs/provisioners/chef.html.markdown @@ -98,8 +98,9 @@ The following arguments are supported: * `ssl_verify_mode (string)` - (Optional) Use to set the verify mode for Chef Client HTTPS requests. -* `enable_reporting (string)` - (Optional) Cause the chef-client to send data to the Chef - server for use with Chef reporting, if flag is omitted default value is `true` +* `disable_reporting (string)` - (Optional) Use to disable the chef-client data sending to + the Chef server for use with Chef reporting, if flag is omitted default behavior is to send + reporting data. * `validation_client_name (string)` - (Required) The name of the validation client to use for the initial communication with the Chef Server. From 84bb5154be3f805c916b757c1aba9011b163b5c8 Mon Sep 17 00:00:00 2001 From: Petr Artamonov Date: Fri, 8 Jan 2016 20:03:22 +0100 Subject: [PATCH 4/4] corrected value type in documentation --- website/source/docs/provisioners/chef.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/source/docs/provisioners/chef.html.markdown b/website/source/docs/provisioners/chef.html.markdown index e61d7bc0b..73ba30524 100644 --- a/website/source/docs/provisioners/chef.html.markdown +++ b/website/source/docs/provisioners/chef.html.markdown @@ -98,7 +98,7 @@ The following arguments are supported: * `ssl_verify_mode (string)` - (Optional) Use to set the verify mode for Chef Client HTTPS requests. -* `disable_reporting (string)` - (Optional) Use to disable the chef-client data sending to +* `disable_reporting (boolean)` - (Optional) Use to disable the chef-client data sending to the Chef server for use with Chef reporting, if flag is omitted default behavior is to send reporting data.