forked from TalkingQuickly/ansible-osx-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansible_ubuntu.yml
87 lines (79 loc) · 2.16 KB
/
ansible_ubuntu.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
- hosts: localhost
tasks:
- name: Update apt and install required system packages
apt:
pkg:
- autoconf
- automake
- coreutils
- curl
- gnu-time
- gpg
- htop
- imagemagick@6
- libtool
- libxslt
- libyaml
- openssl
- git
- pkg-config
- rbenv
- ruby-build
- rbenv-default-gems
- rbenv-gemset
- readline
- sqlite3
- tmux
- unzip
- vim
- zlib
- zsh
state: latest
update_cache: true
- name: Get the path to ZSH
become: false
local_action: command which zsh
register: zsh_path
- name: "Ensure zsh is in allowed shells"
lineinfile:
path: /etc/shells
line: "{{ zsh_path.stdout }}"
become: true
- name: Install Oh My ZSH
shell: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
args:
creates: "$HOME/{{ lookup('env', 'USER') }}/.oh-my-zsh"
- name: Set ZSH as the default shell
shell: chsh -s $(which zsh) {{ lookup('env', 'USER') }}
become: true
- name: Install nvm
become: no
shell: >
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.3/install.sh | bash
args:
executable: /bin/bash
chdir: "$HOME"
creates: "$HOME/.nvm/nvm.sh"
- name: Install node
become: no
shell: >
. {{ ansible_env.HOME }}/.nvm/nvm.sh && nvm install {{ item }}
args:
executable: /bin/bash
chdir: "{{ ansible_env.HOME }}"
creates: "{{ ansible_env.HOME }}/.nvm/versions/{{ item }}"
loop:
- 16.15
- name: "Install Default Ruby"
shell: |
rbenv install 3.2.0
rbenv global 3.2.0
gem install bundler
echo 'bundler' >> "$(brew --prefix rbenv)/default-gems"
echo 'gem: --no-document' >> ~/.gemrc
- name: Install yarn packages
shell: yarn global add {{ item }}
with_items:
- @angular/cli
- typescript