Skip to content

Commit 27f92af

Browse files
authored
Merge pull request GoogleCloudPlatform#2 from bmenasha/master
Define cookbooks path and fix version of chef on leader.
2 parents accea83 + 4898a23 commit 27f92af

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

dm/web-servers.jinja

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ resources:
4949
accessConfigs:
5050
- name: External NAT
5151
type: ONE_TO_ONE_NAT
52-
serviceAccounts:
52+
serviceAccounts:
5353
- email: "default"
54-
scopes:
54+
scopes:
5555
- "https://www.googleapis.com/auth/devstorage.read_only"
5656
- "https://www.googleapis.com/auth/logging.write"
5757
tags:
@@ -72,24 +72,27 @@ resources:
7272
# Download runlist and cookbooks
7373
curl -L {{ properties["chef_node_url"] }} > /tmp/node.json
7474

75+
# Define cookbooks path
76+
echo "cookbooks_path '/var/chef/site-cookbooks'" > /tmp/solo.rb
77+
7578
# Configure instance
76-
chef-solo -l debug -j /tmp/node.json -r {{ properties["chef_cookbook_url"] }}
79+
chef-solo -c /tmp/solo.rb -l debug -j /tmp/node.json -r {{ properties["chef_cookbook_url"] }}
7780
- key: storage-bucket
7881
value: {{ properties["storage_bucket"] }}
7982
- key: dbinstance
8083
value: {{ properties["dbinstance"] }}
8184
- key: dbname
8285
value: {{ properties["dbname"] }}
8386
- key: dbuser
84-
value: {{ properties["dbuser"] }}
87+
value: {{ properties["dbuser"] }}
8588
- key: dbpassword
86-
value: {{ properties["dbpassword"] }}
89+
value: {{ properties["dbpassword"] }}
8790
- key: dbhost
8891
value: {{ properties["dbhost"] }}
8992
- key: gcs-access-key
9093
value: {{ properties["gcs_access_key"] }}
9194
- key: gcs-secret
92-
value: {{ properties["gcs_secret"] }}
95+
value: {{ properties["gcs_secret"] }}
9396

9497
{% for zone in properties["zones"] %}
9598
# Instance Group Manager for web servers
@@ -132,9 +135,9 @@ resources:
132135
accessConfigs:
133136
- name: External NAT
134137
type: ONE_TO_ONE_NAT
135-
serviceAccounts:
138+
serviceAccounts:
136139
- email: "default"
137-
scopes:
140+
scopes:
138141
- "https://www.googleapis.com/auth/devstorage.full_control"
139142
- "https://www.googleapis.com/auth/sqlservice.admin"
140143
- "https://www.googleapis.com/auth/compute"
@@ -152,13 +155,16 @@ resources:
152155
curl -s "https://storage.googleapis.com/signals-agents/logging/google-fluentd-install.sh" | bash
153156

154157
# Install Chef
155-
curl -L https://www.opscode.com/chef/install.sh | bash
158+
curl -LO https://omnitruck.chef.io/install.sh && sudo bash ./install.sh -v 11.18.12 && rm install.sh
156159

157160
# Download runlist and cookbooks
158161
curl -L {{ properties["chef_node_url"] }} > /tmp/node.json
159162

163+
# Define cookbooks path
164+
echo "cookbooks_path '/var/chef/site-cookbooks'" > /tmp/solo.rb
165+
160166
# Configure instance
161-
chef-solo -l debug -j /tmp/node.json -r {{ properties["chef_cookbook_url"] }}
167+
chef-solo -c /tmp/solo.rb -l debug -j /tmp/node.json -r {{ properties["chef_cookbook_url"] }}
162168
- key: storage-bucket
163169
value: {{ properties["storage_bucket"] }}
164170
- key: leader
@@ -168,12 +174,12 @@ resources:
168174
- key: dbname
169175
value: {{ properties["dbname"] }}
170176
- key: dbuser
171-
value: {{ properties["dbuser"] }}
177+
value: {{ properties["dbuser"] }}
172178
- key: dbpassword
173-
value: {{ properties["dbpassword"] }}
179+
value: {{ properties["dbpassword"] }}
174180
- key: dbhost
175181
value: {{ properties["dbhost"] }}
176182
- key: gcs-access-key
177183
value: {{ properties["gcs_access_key"] }}
178184
- key: gcs-secret
179-
value: {{ properties["gcs_secret"] }}
185+
value: {{ properties["gcs_secret"] }}

0 commit comments

Comments
 (0)