-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interconnect attachments. (#210)
Merged PR #210.
- Loading branch information
1 parent
2dd80bd
commit 293bb07
Showing
11 changed files
with
254 additions
and
4 deletions.
There are no files selected for viewing
Submodule ansible
updated
6 files
Submodule compute
updated
12 files
Submodule compute
updated
15 files
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
34 changes: 34 additions & 0 deletions
34
products/compute/examples/ansible/interconnect_attachment.yaml
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 @@ | ||
# Copyright 2018 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::Ansible::Example | ||
task: | ||
!ruby/object:Provider::Ansible::Task | ||
name: gcp_compute_interconnect_attachment | ||
code: | ||
name: <%= ctx[:name] %> | ||
region: us-central1 | ||
project: <%= ctx[:project] %> | ||
auth_kind: <%= ctx[:auth_kind] %> | ||
interconnect: 'https://googleapis.com/compute/v1/projects/<%=ctx[:project]%>/global/interconnects/...' | ||
router: 'https://googleapis.com/compute/v1/projects/<%=ctx[:project]%>/regions/us-central1/routers/...' | ||
service_account_file: <%= ctx[:service_account_file] %> | ||
register: disk | ||
verifier: !ruby/object:Provider::Ansible::Verifier | ||
command: | | ||
gcloud compute interconnects attachments describe | ||
"{{ resource_name }}" | ||
--project="{{ gcp_project}}" | ||
--region="{{ gcp_region}}" | ||
failure: !ruby/object:Provider::Ansible::ComputeFailureCondition | ||
region: global | ||
type: images |
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,35 @@ | ||
<% 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' -%> | ||
<% else -%> | ||
<% end # name == README.md -%> | ||
gcompute_interconnect_attachment <%= example_resource_name('test-interconnect') -%> do | ||
action :create | ||
project 'google.com:graphite-playground' | ||
region 'us-central1' | ||
name <%= example_resource_name('test-interconnect') -%> | ||
interconnect 'projects/$project/global/interconnects/$interconnect' | ||
router 'projects/$project/regions/$region/routers/$router' | ||
credential 'mycred' | ||
end | ||
36 changes: 36 additions & 0 deletions
36
products/compute/examples/puppet/interconnect_attachment.pp
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,36 @@ | ||
<% if false # the license inside this if block pertains to this file -%> | ||
# Copyright 2018 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 :puppet) -%> | ||
|
||
<%= compile 'templates/puppet/examples~credential.pp.erb' -%> | ||
|
||
<% end # name == README.md -%> | ||
gcompute_region { 'us-central1': | ||
project => 'google.com:graphite-playground', | ||
credential => 'mycred', | ||
} | ||
|
||
gcompute_interconnect_attachment { <%= example_resource_name('test-attachment') -%>: | ||
ensure => present, | ||
region => 'us-central1', | ||
name => <%= example_resource_name('test-attachment') -%>, | ||
interconnect => 'https://googleapis.com/compute/v1/projects/...global/interconnects/...', | ||
router => 'https://googleapis.com/compute/v1/projects/...regions/.../routers/...', | ||
project => 'google.com:graphite-playground', | ||
credential => 'mycred', | ||
} |
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