1 #!/usr/bin/env ansible-playbook
2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: Apache-2.0
6 - name: Load Arvados configuration
9 - name: Load Arvados configuration file
10 delegate_to: localhost
11 ansible.builtin.include_vars:
13 file: "{{ arvados_config_file }}"
14 - name: Load Arvados cluster configuration
15 ansible.builtin.set_fact:
16 arvados_cluster: "{{ arvados_config.Clusters[arvados_cluster_id] }}"
17 failed_when: arvados_cluster is undefined
18 - name: Get Crunch dispatch public key
19 delegate_to: localhost
21 key_url: "{{ arvados_cluster.Containers.DispatchPrivateKey | urlsplit }}"
22 ansible.builtin.command:
23 argv: "{{ ['ssh-keygen', '-y'] + (['-f', key_url.path] if key_url.scheme == 'file' else []) }}"
24 stdin: "{{ arvados_cluster.Containers.DispatchPrivateKey if key_url.scheme != 'file' else '' }}"
25 register: compute_dispatch_ssh_keygen
27 - name: Build compute node
28 # `default` is the name that the Packer Ansible plugin assigns to the
29 # instance used to create the image.
33 - name: Bootstrap packages required for Ansible
34 ansible.builtin.raw: "apt-get -o DPkg::Lock::Timeout=300 -qy {{ item }}"
37 - install gnupg python3-apt python3-debian xz-utils
42 - name: Upgrade packages
46 - name: Remove unwanted packages
56 when: "arvados_compute_nvidia|default(false)|bool"
58 name: "compute_{{ arvados_cluster.Containers.RuntimeEngine }}"
60 name: compute_encrypt_tmp
64 - name: Install Arvados FUSE driver
66 name: python3-arvados-fuse
67 - name: Configure FUSE
68 ansible.builtin.lineinfile:
70 regexp: "^[# ]*user_allow_other *$"
71 line: user_allow_other
72 - name: Configure locale
73 ansible.builtin.lineinfile:
75 regexp: "^[# ]*en_US.UTF-8 +UTF-8 *$"
76 line: en_US.UTF-8 UTF-8
79 ansible.builtin.lineinfile:
80 path: /etc/dhcp/dhclient.conf
81 regexp: "^[# ]*prepend +domain-name-servers "
82 line: "prepend domain-name-servers {{ dns_resolver }};"
83 when: dns_resolver is defined
87 ansible.builtin.debug:
88 msg: Skipping apt update handler before an apt upgrade
91 ansible.builtin.command: locale-gen