You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* you might choose to `gem install --user-install` instead so only your
23
-
own `~/.gem` directory is affected (and so you don't need `sudo`)
24
-
* if you're on Mac OS X 10.11, make sure you are using ChefDK 0.8.0
25
-
or higher, so as not to run afoul of
26
-
https://github.com/chef/chef-dk/issues/419
27
-
* if `gem install` gives an error message about unsatisfiable
28
-
constraints on the version of the chef-config gem, add `-f`
29
-
to force-ignore the problem `¯\_(ツ)_/¯` and cross your fingers
30
-
that nothing goes wrong as a result
31
-
32
-
## Get credentials for the typesafe-scala chef.io organization
33
-
34
-
Join chef.io (https://manage.chef.io/signup), and ask on Slack to be invited to the typesafe-scala org.
35
-
36
-
For the CLI to work, you need:
37
-
```
38
-
export CHEF_ORG="typesafe-scala"
39
-
```
40
-
41
-
If your username on chef.io does not match the local username on your machine, you also need
42
-
```
43
-
export CHEF_USER="[username]"
44
-
```
45
-
46
-
## Get your public key added
47
-
48
-
Open a pull request, modeled on https://github.com/scala/scala-jenkins-infra/pull/106,
49
-
to add your own ssh public key (not an Amazon-provided key; a personal key of your
50
-
own) to `attributes/pubkeys.rb`, so you can use your key to ssh to the various servers.
51
-
52
-
## Set up directories
53
-
54
-
```
55
-
mkdir -p ~/git/cookbooks
56
-
cd ~/git/cookbooks
57
-
git init .
58
-
git commit --allow-empty -m "Initial"
59
-
git config core.autocrlf false
60
-
hub clone scala/scala-jenkins-infra
61
-
cd scala-jenkins-infra
62
-
ln -sh ~/git/cookbooks $PWD/.chef/
63
-
mkdir .chef/config
64
-
```
65
-
66
-
(The `core.autocrlf` thing may be needed to prevent "fatal: CRLF would be replaced by LF" errors when cloning cookbook repos, depending on your global git config.)
67
-
68
-
You can then generate and download your private key on https://manage.chef.io/organizations/typesafe-scala/users. Put it in `~/git/cookbooks/scala-jenkins-infra/.chef/config/$CHEF_USER.pem`. Then you can use knife without further config. See `.chef/knife.rb` for key locations.
69
-
70
-
Test if knife works correctly by running `knife cookbook list`.
71
12
72
13
## Hosts and SSH config
73
14
@@ -98,22 +39,40 @@ it's only ssh-able from jenkins-master itself; see below.)
98
39
Add the following to your `~/.ssh/config`:
99
40
100
41
```
101
-
Host jenkins-master
42
+
Host jenkins-worker-publish
43
+
IdentityFile /Users/adriaan/.ssh/ansible.pem
102
44
User admin
103
45
104
46
Host jenkins-worker-behemoth-1
105
-
User ubuntu
47
+
IdentityFile /Users/adriaan/.ssh/ansible.pem
48
+
User admin
106
49
107
50
Host jenkins-worker-behemoth-2
108
-
User ubuntu
51
+
IdentityFile /Users/adriaan/.ssh/ansible.pem
52
+
User admin
109
53
110
-
Host jenkins-worker-ubuntu-publish
111
-
User ubuntu
54
+
Host jenkins-worker-behemoth-3
55
+
IdentityFile /Users/adriaan/.ssh/ansible.pem
56
+
User admin
57
+
58
+
Host jenkins-master
59
+
IdentityFile /Users/adriaan/.ssh/ansible.pem
60
+
User admin
112
61
113
62
Host scabot
114
63
HostName jenkins-master
115
-
IdentityFile $PWD/.chef/scabot.pem
116
64
User scabot
65
+
66
+
Host jenkins-worker-windows-publish
67
+
HostName 172.31.0.178
68
+
IdentityFile ~/.ssh/scala-jenkins.pem
69
+
User jenkins
70
+
ProxyCommand ssh -q -W %h:%p jenkins-master
71
+
72
+
Host influxdb
73
+
HostName 172.31.0.100
74
+
User ubuntu
75
+
ProxyCommand ssh -q -W %h:%p jenkins-master
117
76
```
118
77
119
78
Verify that you can actually ssh to the various machines.
@@ -186,25 +145,7 @@ ssh'ing to jenkins-master first. From jenkins-master, do:
186
145
which should get you to a Cygwin prompt. (If it doesn't work, maybe
187
146
you forgot to bring the Windows node online first?)
188
147
189
-
Missing key? If you find that `~/.ssh/jenkins_id_rsa` isn't
190
-
present on jenkins-master, you can recreate it as follows.
191
-
The keypair is stored in our Chef vault (as provided by the chef-vault
192
-
cookbook) as `scala-jenkins-keypair`. Here's how to retrieve it:
193
-
194
-
knife vault show --format json master scala-jenkins-keypair \
195
-
| jq -r .private_key > jenkins_id_rsa
196
-
knife vault show --format json master scala-jenkins-keypair \
197
-
| jq -r .public_key > jenkins_id_rsa.pub
198
-
199
-
From there, you can `scp` it up to `~/.ssh` on jenkins-master.
200
-
201
-
If you get "master/scala-jenkins-keypair is not encrypted with your
202
-
public key", that means you must ask one of the existing vault admins
0 commit comments