-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chef Spanner + Fixing Puppet Spanner (#377)
Merged PR #377.
- Loading branch information
1 parent
faf4672
commit 83b5501
Showing
26 changed files
with
396 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule compute
updated
32 files
Submodule dns
updated
3 files
+5 −5 | resources/managed_zone.rb | |
+1 −1 | resources/project.rb | |
+1 −1 | resources/resource_record_set.rb |
Submodule sql
updated
6 files
+1 −1 | resources/database.rb | |
+4 −4 | resources/flag.rb | |
+4 −4 | resources/instance.rb | |
+4 −4 | resources/ssl_cert.rb | |
+2 −2 | resources/tier.rb | |
+1 −1 | resources/user.rb |
Submodule storage
updated
4 files
+6 −6 | resources/bucket.rb | |
+4 −4 | resources/bucket_access_control.rb | |
+6 −6 | resources/default_object_acl.rb | |
+6 −6 | resources/object_access_control.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# Copyright 2017 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- !ruby/object:Provider::Chef::Config | ||
manifest: !ruby/object:Provider::Chef::Manifest | ||
version: '0.1.0' | ||
source: 'https://github.com/GoogleCloudPlatform/chef-google-spanner' | ||
issues: 'https://github.com/GoogleCloudPlatform/chef-google-spanner/issues' | ||
summary: 'A Chef cookbook to manage Google Cloud Spanner resources' | ||
description: | | ||
This cookbook provides the built-in types and services for Chef to manage | ||
Google Cloud Spanner resources, as native Chef types. | ||
depends: | ||
- !ruby/object:Provider::Config::Requirements | ||
name: 'google-gauth' | ||
versions: '< 0.2.0' | ||
operating_systems: | ||
<%= indent(include('provider/chef/common~operating_systems.yaml'), 4) %> | ||
overrides: !ruby/object:Provider::ResourceOverrides | ||
Database: !ruby/object:Provider::Chef::ResourceOverride | ||
handlers: !ruby/object:Provider::Chef::Handlers | ||
resource_to_request_patch: | | ||
request[:create_statement] = "CREATE DATABASE `#{request[:name]}`" | ||
request.delete(:name) | ||
collection: | | ||
URI.join( | ||
'https://spanner.googleapis.com/v1/', | ||
expand_variables( | ||
'projects/{{project}}/instances/{{instance}}/databases', | ||
data | ||
).split('/').map { |p| p.gsub('%3A', ':') } | ||
.join('/') | ||
) | ||
self_link: | | ||
URI.join( | ||
'https://spanner.googleapis.com/v1/', | ||
expand_variables( | ||
'projects/{{project}}/instances/{{instance}}/databases/{{name}}', | ||
data | ||
).split('/').map { |p| p.gsub('%3A', ':') } | ||
.join('/') | ||
) | ||
provider_helpers: | ||
- 'products/spanner/helpers/ruby/database_helpers.rb.erb' | ||
Instance: !ruby/object:Provider::Chef::ResourceOverride | ||
custom_create_resource: true | ||
custom_update_resource: true | ||
handlers: !ruby/object:Provider::Chef::Handlers | ||
collection: | | ||
URI.join( | ||
'https://spanner.googleapis.com/v1/', | ||
expand_variables( | ||
'projects/{{project}}/instances', | ||
data | ||
).split('/').map { |p| p.gsub('%3A', ':') } | ||
.join('/') | ||
) | ||
self_link: | | ||
URI.join( | ||
'https://spanner.googleapis.com/v1/', | ||
expand_variables( | ||
'projects/{{project}}/instances/{{name}}', | ||
data | ||
).split('/').map { |p| p.gsub('%3A', ':') } | ||
.join('/') | ||
) | ||
provider_helpers: | ||
- 'products/spanner/helpers/ruby/instance_helpers.rb.erb' | ||
- 'products/spanner/helpers/chef/instance_helpers.rb.erb' | ||
InstanceConfig: !ruby/object:Provider::Chef::ResourceOverride | ||
deprecated: true | ||
handlers: !ruby/object:Provider::Chef::Handlers | ||
collection: | | ||
URI.join( | ||
'https://spanner.googleapis.com/v1/', | ||
expand_variables( | ||
'projects/{{project}}/instanceConfigs', | ||
data | ||
).split('/').map { |p| p.gsub('%3A', ':') } | ||
.join('/') | ||
) | ||
self_link: | | ||
URI.join( | ||
'https://spanner.googleapis.com/v1/', | ||
expand_variables( | ||
'projects/{{project}}/instanceConfigs/{{name}}', | ||
data | ||
).split('/').map { |p| p.gsub('%3A', ':') } | ||
.join('/') | ||
) | ||
provider_helpers: | ||
- 'products/spanner/helpers/ruby/instance_config_helpers.rb.erb' | ||
tests: !ruby/object:Api::Resource::HashArray | ||
<%= indent(include('products/spanner/test.yaml'), 2) %> | ||
examples: !ruby/object:Api::Resource::HashArray | ||
Database: | ||
- database.rb | ||
Instance: | ||
- delete_instance.rb | ||
- instance.rb | ||
files: !ruby/object:Provider::Config::Files | ||
copy: | ||
<%= indent(compile('provider/chef/common~copy.yaml'), 4) %> | ||
compile: | ||
<%= indent(include('provider/chef/common~compile~before.yaml'), 4) %> | ||
<%= indent(include('provider/chef/common~compile~after.yaml'), 4) %> | ||
<% # common~compile~after.yaml should be the last line of compile: section -%> | ||
test_data: !ruby/object:Provider::Config::TestData | ||
network: !ruby/object:Api::Resource::HashArray | ||
Instance: | ||
- success1~name | ||
- success1~title | ||
- success2~name | ||
- success2~title | ||
- success3~name | ||
- success3~title | ||
changelog: | ||
- !ruby/object:Provider::Config::Changelog | ||
version: '0.1.0' | ||
date: 2017-10-10T06:00:00-0700 | ||
general: 'Initial release' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<% if false # the license inside this if block assertains to this file -%> | ||
# Copyright 2017 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
<% end -%> | ||
<% unless name == 'README.md' -%> | ||
|
||
<%= compile 'templates/license.erb' -%> | ||
<%= lines(autogen_notice :chef) -%> | ||
|
||
<%= compile 'templates/chef/example~auth.rb.erb' -%> | ||
<% end -%> | ||
gspanner_instance <%= example_resource_name('my-spanner') -%> do | ||
action :create | ||
display_name 'My Spanner Instance' | ||
node_count 2 | ||
labels({ | ||
'cost-center' => 'ti-1700004' | ||
}) | ||
config 'regional-us-central1' | ||
project ENV['PROJECT'] | ||
credential 'mycred' | ||
end | ||
|
||
gspanner_database <%= example_resource_name('webstore') -%> do | ||
action :create | ||
instance <%= example_resource_name('my-spanner') %> | ||
extra_statements [ | ||
'CREATE TABLE customers ( | ||
customer_id INT64 NOT NULL, | ||
last_name STRING(MAX) | ||
) PRIMARY KEY (customer_id)' | ||
] | ||
project ENV['PROJECT'] | ||
credential 'mycred' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<% if false # the license inside this if block assertains to this file -%> | ||
# Copyright 2017 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
<% end -%> | ||
<% unless name == 'README.md' -%> | ||
|
||
<%= compile 'templates/license.erb' -%> | ||
<%= lines(autogen_notice :chef) -%> | ||
|
||
<%= compile 'templates/chef/example~auth.rb.erb' -%> | ||
<% end -%> | ||
gspanner_instance <%= example_resource_name('my-spanner') -%> do | ||
action :delete | ||
project ENV['PROJECT'] | ||
credential 'mycred' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<% if false # the license inside this if block assertains to this file -%> | ||
# Copyright 2017 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
<% end -%> | ||
<% unless name == 'README.md' -%> | ||
|
||
<%= compile 'templates/license.erb' -%> | ||
<%= lines(autogen_notice :chef) -%> | ||
|
||
<%= compile 'templates/chef/example~auth.rb.erb' -%> | ||
<% end -%> | ||
gspanner_instance <%= example_resource_name('my-spanner') -%> do | ||
action :create | ||
display_name 'My Spanner Instance' | ||
node_count 2 | ||
labels({ | ||
'cost-center' => 'ti-1700004' | ||
}) | ||
config 'regional-us-central1' | ||
project ENV['PROJECT'] | ||
credential 'mycred' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<% if false # the license inside this if block assertains to this file -%> | ||
# Copyright 2017 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
<% end -%> | ||
<% unless name == 'README.md' -%> | ||
|
||
<%= compile 'templates/license.erb' -%> | ||
<%= lines(autogen_notice :chef) -%> | ||
|
||
<%= compile 'templates/chef/example~auth.rb.erb' -%> | ||
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<% if false # the license inside this if block assertains to this file -%> | ||
# Copyright 2017 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
<% end -%> | ||
<% unless name == 'README.md' -%> | ||
|
||
<%= compile 'templates/license.erb' -%> | ||
<%= lines(autogen_notice :chef) -%> | ||
|
||
<%= compile 'templates/chef/example~auth.rb.erb' -%> | ||
<% end -%> | ||
gspanner_instance <%= example_resource_name('my-spanner') -%> do | ||
action :create | ||
display_name 'My Spanner Instance' | ||
node_count 2 | ||
labels [ | ||
{ | ||
'cost-center' => 'ti-1700004' | ||
} | ||
] | ||
config 'regional-us-central1' | ||
project ENV['PROJECT'] | ||
credential 'mycred' | ||
end | ||
|
||
gspanner_database <%= example_resource_name('webstore') -%> do | ||
action :create | ||
instance <%= example_resource_name('my-spanner') %> | ||
extra_statements [ | ||
'CREATE TABLE customers ( | ||
customer_id INT64 NOT NULL, | ||
last_name STRING(MAX) | ||
) PRIMARY KEY (customer_id)' | ||
] | ||
project ENV['PROJECT'] | ||
credential 'mycred' | ||
end |
Oops, something went wrong.