@@ -37,10 +37,14 @@ Before you can run our Ansible playbooks, you need to meet the following
37
37
prerequisites:
38
38
39
39
* Create a DigitalOcean API token, and pass it to the inventory generator by
40
- setting the ` DO_API_TOKEN ` environment variable.
40
+ setting the ` DO_API_TOKEN ` environment variable. The API token must have
41
+ access to the following scopes:
42
+ - Read: droplet, firewall, monitoring, project, ssh_key
43
+ - Create: droplet
44
+ - Update: droplet, monitoring, project
41
45
* If you are creating a new droplet, and want to configure DNS as well, then
42
- create a CloudFlare API token, and pass it to the Ansible playbook by setting
43
- the ` CLOUDFLARE_TOKEN ` environment variable.
46
+ create a CloudFlare API token with DNS edit permissions , and pass it to the
47
+ Ansible playbook by setting the ` CLOUDFLARE_TOKEN ` environment variable.
44
48
* Set the vault decryption password of the Ansible vaulted file with our
45
49
secrets. This may be done by setting the ` ANSIBLE_VAULT_PASSWORD_FILE `
46
50
environment variable to point to a file containing the password.
@@ -117,7 +121,7 @@ Initial setup
117
121
The summary of the initial setup is:
118
122
119
123
1 . Create the droplet with monitoring and relevant SSH keys.
120
- 2 . Assign new droplet to the matplotlib.org project and the Web firewall .
124
+ 2 . Assign new droplet to the matplotlib.org project.
121
125
3 . Add DNS entries pointing to the server on CloudFlare.
122
126
4 . Grab the SSH host fingerprints.
123
127
5 . Reboot.
@@ -144,7 +148,8 @@ ansible-playbook create.yml --extra-vars "host=pluto functional=web99 ssh_keys='
144
148
145
149
The playbook will create the server, as well as add DNS records on CloudFlare.
146
150
Note, you must set ` DO_API_TOKEN ` and ` CLOUDFLARE_TOKEN ` in the environment to
147
- access these services.
151
+ access these services. The droplet ID and IP address will be printed at the
152
+ end of the playbook.
148
153
149
154
Then, to ensure you are connecting to the expected server, you should grab the
150
155
SSH host keys via the DigitalOcean Droplet Console:
@@ -159,16 +164,21 @@ Note down the outputs to verify later, e.g.,
159
164
160
165
```
161
166
# Use these for comparison when connecting yourself.
162
- 1024 SHA256:J2sbqvhI/VszBtVvPabgxyz6sRnGLrZUn0kqfv4doAM [email protected] (DSA)
163
- 256 SHA256:J0rOMayXhL1+5wbm4WQNpAvmscDjqwJjAtk1SLemRMI [email protected] (ECDSA)
164
- 256 SHA256:y8EDRGMpLWOW72x47MVKsAfSAl8JHjsOc/RGaiMTPGs [email protected] (ED25519)
165
- 3072 SHA256:AyuNO8FES5k9vobv0Pu9XpvtjVFZ1bTTNxb1lo+AuRA [email protected] (RSA)
167
+ 256 SHA256:p6MiA8+IO1WcpXHDOQ4rhiVCo+MDxWB7ehfNfxvbDkU [email protected] (ECDSA)
168
+ 256 SHA256:RfDahJqnQFLeFN+zl9f+hmB+W05OoZK26NfNQkj6KtY [email protected] (ED25519)
169
+ 3072 SHA256:tYwdULlz5/XP5Ze7PCj9XpO3VIMEZkiOiFuhr9nke34 [email protected] (RSA)
166
170
```
167
171
168
172
Finally, you should reboot the droplet. This is due to a bug in cloud-init on
169
173
DigitalOcean, which generates a new machine ID after startup, causing system
170
174
logs to be seem invisible.
171
175
176
+ This can be done from the Console, or via the CLI:
177
+
178
+ ```
179
+ doctl compute droplet-action reboot <droplet-id>
180
+ ```
181
+
172
182
Running Ansible
173
183
---------------
174
184
0 commit comments