Skip to content

Commit 03c2717

Browse files
authored
Merge pull request #620 from rust-lang/fix-dev-desktop-role
Fix the Ansible playbook for dev-desktops
2 parents 5cd914d + 8a34892 commit 03c2717

File tree

5 files changed

+33
-10
lines changed

5 files changed

+33
-10
lines changed

ansible/playbooks/dev-desktop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
datadog_api_key: "{{ vars_datadog_api_key }}"
1818
datadog_site: "datadoghq.com"
1919

20+
datadog_agent_version: "7.56.2"
2021
datadog_config:
2122
tags:
2223
- "env:{{ vars_environment }}"

ansible/roles/dev-desktop/defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
vars_rustup_version: "1.27.1"
3+
vars_rustup_checksum: "32a680a84cf76014915b3f8aa44e3e40731f3af92cd45eb0fcc6264fd257c428"
24

35
vars_team_login_path: "/root/team_login"
46
allow_ssh_extra_groups: "dev-desktop-allow-ssh"

ansible/roles/dev-desktop/tasks/dependencies.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
- clang
1717
- cmake
1818
- gcc-mingw-w64-x86-64 # Allows running `x check --target x86_64-pc-windows-gnu`
19-
- earlyoom # Earlyoom kills processes using too much memory before they can cause trouble.
2019
- jq
2120
- libssl-dev
2221
- llvm
@@ -115,15 +114,20 @@
115114
- linux-image-extra-virtual
116115
when: kernel_flavor.stdout == "generic"
117116

118-
- name: Install rustup in userspace for root
119-
shell: |
120-
set -eu
121-
RUSTUP_VERSION=1.24.3
122-
RUSTUP_SHA="a3cb081f88a6789d104518b30d4aa410009cd08c3822a1226991d6cf0442a0f8"
123-
curl --proto '=https' --tlsv1.2 -sSf -O \
124-
https://raw.githubusercontent.com/rust-lang/rustup/${RUSTUP_VERSION}/rustup-init.sh
125-
echo "${RUSTUP_SHA} rustup-init.sh" | sha256sum --check --
126-
sh rustup-init.sh --default-toolchain nightly -y --component rust-src
117+
- name: Download Rustup installer
118+
ansible.builtin.get_url:
119+
url: "https://raw.githubusercontent.com/rust-lang/rustup/{{ vars_rustup_version }}/rustup-init.sh"
120+
dest: /tmp/rustup-init.sh
121+
mode: 0744
122+
checksum: "sha256:{{ vars_rustup_checksum }}"
123+
124+
- name: Install Rustup in userspace for root
125+
ansible.builtin.command: /tmp/rustup-init.sh --default-toolchain nightly -y --component rust-src
126+
127+
- name: Clean up Rustup installer
128+
ansible.builtin.file:
129+
path: /tmp/rustup-init.sh
130+
state: absent
127131

128132
- name: Check if Node is installed
129133
command: node --version

ansible/roles/dev-desktop/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22

3+
- include_tasks: oom.yml
34
- include_tasks: dependencies.yml
45
- include_tasks: podman.yml
56
- include_tasks: quota.yml
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
# earlyoom kills processes using too much memory before they can cause trouble.
3+
- name: Install earlyoom
4+
ansible.builtin.apt:
5+
name: earlyoom
6+
state: present
7+
8+
# The staging instance is so small that earlyoom prevents Ansible from executing
9+
# the playbook successfully.
10+
- name: Disable earlyoom on staging
11+
ansible.builtin.service:
12+
name: earlyoom
13+
enabled: no
14+
state: stopped
15+
when: ansible_hostname == "dev-desktop-staging"

0 commit comments

Comments
 (0)