-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
60 lines (53 loc) · 1.66 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- name: Preconfig
hosts: lvhw
tasks:
- name: Install aptitude
apt:
name: aptitude
state: latest
update_cache: true
- name: Install required system packages
apt:
pkg:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- python3-pip
- virtualenv
- python3-setuptools
state: latest
update_cache: true
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu focal stable
state: present
- name: Update apt and install docker-ce
apt:
name: docker-ce
state: latest
update_cache: true
- name: Setup Node and NVM
become: true
become_flags: -i # Execute config files such as .profile (Ansible uses non-interactive login shells)
become_user: root
block:
- name: nvm
shell: >
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
args:
creates: '{{ ansible_env.HOME }}/.nvm/nvm.sh'
- name: Setup .profile
ansible.builtin.lineinfile:
path: ~/.profile
line: source ~/.nvm/nvm.sh # This will make sure Node is on the user's PATH
create: yes
- name: Install node
shell: 'source /root/.nvm/nvm.sh && nvm install 16.16.0'
args:
executable: /bin/bash