Skip to content

Commit 2331ebb

Browse files
author
aayushjain16
committed
update
1 parent d186c26 commit 2331ebb

File tree

1 file changed

+47
-112
lines changed

1 file changed

+47
-112
lines changed

ansible_osx.yml

Lines changed: 47 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
community.general.homebrew_tap:
1818
name: [
1919
adoptopenjdk/openjdk,
20-
fishtown-analytics/dbt,
21-
heroku/brew,
2220
homebrew/cask-versions,
2321
thoughtbot/formulae,
2422
weaveworks/tap,
@@ -29,76 +27,45 @@
2927
name: "{{ item }}"
3028
ignore_errors: yes
3129
with_items:
32-
- 1password
33-
- android-sdk
34-
- android-studio
35-
- datagrip
30+
# - datagrip
3631
- docker
37-
- dropbox
38-
- figma
3932
- google-chrome
40-
- google-cloud-sdk
4133
- iterm2
42-
- kindle
43-
- ngrok
44-
- slack
4534
- sublime-text
4635
- telegram
4736
- visual-studio-code
4837
- vlc
49-
- zoom
50-
- tuple
5138

5239
- name: "Install homebrew packages"
5340
community.general.homebrew:
5441
name: [
5542
'autoconf',
5643
'automake',
57-
'aws-iam-authenticator',
5844
'awscli',
45+
'atuin',
5946
'bfg',
6047
'coreutils',
6148
'curl',
62-
6349
'direnv',
6450
'dnsmasq',
6551
'fzf',
6652
'gnu-time',
67-
'gpg',
68-
'heroku',
53+
'gh',
6954
'htop',
70-
'imagemagick@6',
71-
'kubectx',
72-
'kubernetes-cli',
73-
'kubernetes-helm',
7455
'libtool',
7556
'libxslt',
7657
'libyaml',
77-
'mas',
7858
'openssl' ,
79-
'pkg-config',
80-
'postgresql',
81-
'rcm',
8259
'readline',
83-
'redis',
84-
'sqlite3',
85-
'tmux',
86-
'unixodbc',
8760
'unzip',
88-
'vim',
89-
'watchman',
90-
'xz',
91-
'yarn',
9261
'zlib',
9362
'zsh',
63+
'pipx',
64+
'tldr'
9465
]
9566
state: present
9667
update_homebrew: yes
9768

98-
- name: "Install from Mac app store"
99-
shell: mas install {{ item }}
100-
with_items:
101-
- 497799835 # xcode
10269

10370
- name: Get the path to ZSH
10471
become: false
@@ -139,37 +106,12 @@
139106
src: templates/vscode-keybindings.json.j2
140107
dest: /Users/{{ lookup('env', 'USER') }}/Library/Application Support/Code/User/keybindings.json
141108
owner: "{{ lookup('env', 'USER') }}"
142-
force: yes
143-
144-
# Add something which ensures path is set here
145-
- name: Install VSCode extensions
146-
shell: code --install-extension {{ item }}
147-
with_items:
148-
- apollographql.vscode-apollo
149-
- bradlc.vscode-tailwindcss
150-
- castwide.solargraph
151-
- clinyong.vscode-css-modules
152-
- eamodio.gitlens
153-
- jakebecker.elixir-ls
154-
- kaiwood.endwise
155-
- karunamurti.haml
156-
- ms-vscode-remote.vscode-remote-extensionpack
157-
- ms-vscode.vscode-typescript-tslint-plugin
158-
- msjsdiag.debugger-for-chrome
159-
- rebornix.ruby
160-
- richie5um2.vscode-sort-json
161-
- Tyriar.sort-lines
162-
- vscodevim.vim
163-
- wholroyd.jinja
164-
- wingrunr21.vscode-ruby
165-
- xabikos.javascriptsnippets
166-
- streetsidesoftware.code-spell-checker
167-
- fabiospampinato.vscode-todo-plus
109+
force: yes
168110

169111
- git:
170112
repo: https://github.com/asdf-vm/asdf.git
171113
dest: "/Users/{{ lookup('env', 'USER') }}/.asdf"
172-
version: v0.8.1
114+
version: v0.14.0
173115

174116
- name: "Create a default asdf configuration"
175117
template:
@@ -183,61 +125,54 @@
183125
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
184126
asdf plugin-add {{ item }} || exit 0
185127
with_items:
186-
- ruby
187-
- elixir
188-
- nodejs
189128
- python
190-
- erlang
191129

192130
- name: "Install Default Python"
193131
shell: |
194132
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
195-
asdf install python 3.10.0
196-
asdf global python 3.10.0
133+
asdf install python 3.12.2
134+
asdf global python 3.12.2
197135
pip3 install ansible
198136
asdf reshim python
199-
200-
- name: "Install Default Ruby"
201-
shell: |
202-
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
203-
asdf install ruby 3.0.2
204-
asdf global ruby 3.0.2
205-
gem install bundler
206-
gem install cocoapods
207-
gem install rubocop
208-
gem install solargraph
209-
210-
- name: "Install default node"
211-
shell: |
212-
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
213-
bash /Users/{{ lookup('env', 'USER') }}/.asdf/plugins/nodejs/bin/import-release-team-keyring
214-
asdf install nodejs 16.4.2
215-
asdf global nodejs 16.4.2
216-
217-
- name: "Install default erlang"
137+
138+
- name: "Setup pipx and venv and atuin"
218139
shell: |
219-
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
220-
asdf install erlang 24.0.2
221-
asdf global erlang 24.0.2
222-
223-
224-
- name: "Install default elixir"
140+
echo "alias pip=pipx" >> /Users/{{ lookup('env', 'USER') }}/.zshrc
141+
echo 'eval "$(atuin init zsh)"' >> /Users/{{ lookup('env', 'USER') }}/.zshrc
142+
pipx ensurepath
143+
source /Users/{{ lookup('env', 'USER') }}/.zshrc
144+
pip install virtualenv
145+
mkdir /Users/{{ lookup('env', 'USER') }}/venv
146+
147+
- name: Add venv() function to zshrc
148+
blockinfile:
149+
path: "/Users/{{ lookup('env', 'USER') }}/.zshrc"
150+
block: |
151+
venv() {
152+
local env_name="$1"
153+
local venv_path="$HOME/venv/$env_name"
154+
155+
if [ -d "$venv_path" ]; then
156+
# If the virtual environment exists, activate it
157+
source "$venv_path/bin/activate"
158+
else
159+
# If the virtual environment doesn't exist, create it and activate it
160+
virtualenv "$venv_path"
161+
source "$venv_path/bin/activate"
162+
fi
163+
}
164+
165+
- name: Create ssh key for github
225166
shell: |
226-
source /Users/{{ lookup('env', 'USER') }}/.asdf/asdf.sh
227-
asdf install elixir 1.12.3-otp-24
228-
asdf global elixir 1.12.3-otp-24
229-
mix local.hex --force
230-
231-
- name: Install yarn packages
232-
shell: yarn global add {{ item }}
233-
with_items:
234-
- react-native-cli
235-
- create-react-app
236-
- apollo
237-
- generator-generator
238-
- yo
239-
240-
- name: re-generate bins now we've installed some yarn packages
241-
shell: asdf reshim nodejs
167+
mkdir /Users/{{ lookup('env', 'USER') }}/.ssh
168+
touch /Users/{{ lookup('env', 'USER') }}/.ssh/config
169+
# DO THE FOLLOWING
170+
# cd ~/.ssh
171+
# ssh-keygen -t ed25519 -C "[email protected]"
172+
# ssh-add --apple-use-keychain ~/.ssh/github
173+
# pbcopy < ~/.ssh/github.pub
174+
# copy the ssh key to github->settings->ssh keys
175+
176+
242177

243178

0 commit comments

Comments
 (0)