Skip to content

Commit 6f2cae4

Browse files
authored
Merge pull request #4 from moshthepitt/further-setup
Further setup
2 parents 16e357a + 468ce24 commit 6f2cae4

19 files changed

+365
-14
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.venv
33
.vagrant/
44
*.log
5-
inventories/
5+
inventories/
6+
mosh-inventory/

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@ ansible-playbook playbook.yml -vv --ask-sudo-pass
1313
## Software installed
1414

1515
- fish
16+
- qgis
17+
- mosh
18+
- gdebi-core
19+
- nodejs
20+
- yarn
21+
- n
22+
- dbeaver
1623

1724
## Things configured
1825

1926
- git
2027
- fish
28+
- tmux

roles/mosh/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
Really simple role that sets up a fresh computer.
44

5+
## Notes
6+
7+
- After the SSH private key is put in place, you may have to generate a public key like so:
8+
9+
```sh
10+
$ ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
11+
Enter passphrase:
12+
```
13+
514
## License
615

716
MIT

roles/mosh/defaults/main.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ mosh_system_user: mosh
66
mosh_configure_git: true
77
mosh_git_user_email: [email protected]
88
mosh_git_user_name: Kelvin Jayanoris
9+
mosh_gh_token:
910

1011
# python
1112
mosh_install_python: true
@@ -14,15 +15,18 @@ mosh_default_python_version: python3.6
1415
mosh_python_versions:
1516
- '{{ mosh_default_python_version }}'
1617
- python3.7
18+
mosh_pip_download_url: https://bootstrap.pypa.io/get-pip.py
1719
mosh_python_packages:
1820
- pip
1921
- pip-tools
2022
- cookiecutter
2123
- ansible-vault
24+
- pipenv
2225

2326
# fish
2427
mosh_install_fish: true
2528
mosh_fish_ppa: ppa:fish-shell/release-3
29+
mosh_omf_download_url: https://get.oh-my.fish
2630
mosh_update_omf: false
2731
mosh_active_fish_theme: zish
2832
mosh_fish_plugins:
@@ -37,6 +41,9 @@ mosh_fish_plugins:
3741
- kill-on-port # https://github.com/vincentjames501/fish-kill-on-port
3842
- bass # https://github.com/edc/bass
3943
mosh_show_current_virtual_env: true
44+
mosh_fish_set_locale: true
45+
mosh_install_fisher: false
46+
mosh_set_ssh_agent: true
4047

4148
# system packages
4249
mosh_install_system_wide_packages: true
@@ -47,6 +54,19 @@ mosh_system_wide_packages:
4754
- whois
4855
- xclip
4956
- fonts-powerline
57+
- qgis
58+
- mosh
59+
- gdebi-core
60+
- python3-dev
61+
- python3-setuptools
62+
- redis-server
63+
- postgresql-10
64+
- postgis
65+
- mysql-server
66+
67+
# environment variables
68+
mosh_env_vars:
69+
TESTVARX: 'yes'
5070

5171
# aws
5272
mosh_configure_aws: true
@@ -58,6 +78,9 @@ mosh_aws_secret_access_key: hunter2
5878
mosh_configure_vault: true
5979
mosh_vault_password: hunter2
6080
mosh_vault_token: hunter2
81+
mosh_vault_bin_path: /usr/local/bin/vault
82+
mosh_vault_addr: http://example.com
83+
mosh_vault_login_user: moshthepitt
6184

6285
# ssh
6386
mosh_copy_ssh_key: true
@@ -75,3 +98,23 @@ mosh_tmux_extra_configs:
7598
- tmux_conf_theme_right_separator_sub='\uE0B3'
7699
- tmux_conf_battery_status_charging='🔌 ' # U+1F50C
77100
- tmux_conf_battery_status_discharging='🔋 ' # U+1F50B
101+
102+
# nodejs
103+
mosh_install_node: true
104+
mosh_install_yarn: true
105+
mosh_node_version: 12.x
106+
mosh_yarn_download_url: https://dl.yarnpkg.com/debian/pubkey.gpg
107+
mosh_yarn_sources_url: https://dl.yarnpkg.com/debian/
108+
109+
# golang
110+
mosh_install_golang: true
111+
mosh_golang_download_url: https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
112+
113+
# dbeaver
114+
mosh_install_dbeaver: true
115+
mosh_dbeaver_download_url: https://dbeaver.io/files/dbeaver-ce_latest_amd64.deb
116+
117+
# spotify
118+
mosh_install_spotify: true
119+
mosh_spotify_download_url: https://download.spotify.com/debian/pubkey.gpg
120+
mosh_spotify_repository_url: http://repository.spotify.com

roles/mosh/tasks/configure/env.yml

Whitespace-only changes.

roles/mosh/tasks/configure/fish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,13 @@
7171
owner: '{{ mosh_system_user }}'
7272
group: '{{ mosh_system_user }}'
7373
mode: '0644'
74+
75+
- name: Copy fisherfile
76+
template:
77+
src: templates/fishfile.j2
78+
dest: '{{ mosh_fisherfile_location }}'
79+
owner: '{{ mosh_system_user }}'
80+
group: '{{ mosh_system_user }}'
81+
mode: '0644'
82+
when:
83+
- mosh_install_fisher == true

roles/mosh/tasks/configure/python.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
shell: '{{ mosh_default_python_version }} {{ mosh_pip_download_location }} --user'
2727
become: yes
2828
become_user: "{{ mosh_system_user }}"
29+
when:
30+
- registered_pip.rc > 1
2931

3032
- name: Install Python packages using pip
3133
shell: "{{ mosh_pip_location }} install --upgrade {{ item }} --user"

roles/mosh/tasks/install/dbeaver.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
- name: Check if dbeaver is installed
3+
shell: test -e {{ mosh_dbeaver_location }}
4+
register: dbeaver_check
5+
failed_when: dbeaver_check.rc == 2
6+
become: yes
7+
become_user: "{{ mosh_system_user }}"
8+
9+
- name: Download dbeaver
10+
get_url:
11+
url: '{{ mosh_dbeaver_download_url }}'
12+
dest: '{{ mosh_dbeaver_download_location }}'
13+
become: yes
14+
become_user: "{{ mosh_system_user }}"
15+
when:
16+
- dbeaver_check.rc > 0
17+
18+
- name: Update apt cache
19+
apt:
20+
update_cache: true
21+
when:
22+
- dbeaver_check.rc > 0
23+
24+
- name: Install dbeaver
25+
shell: gdebi {{ mosh_dbeaver_download_location }} --non-interactive
26+
become: True
27+
become_user: root
28+
when:
29+
- dbeaver_check.rc > 0

roles/mosh/tasks/install/fish.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
---
2+
- name: Check if fish is installed
3+
shell: test -e {{ mosh_fish_location }}
4+
register: fish_check
5+
failed_when: fish_check.rc == 2
6+
become: yes
7+
become_user: "{{ mosh_system_user }}"
8+
29
- name: Add fish PPA
3-
apt_repository:
4-
repo: "{{ mosh_fish_ppa }}"
5-
state: present
6-
become: true
10+
shell: add-apt-repository {{ mosh_fish_ppa }} -y
11+
become: yes
712
become_user: root
813
when:
914
- mosh_fish_ppa is defined
1015
- mosh_fish_ppa != ''
16+
- fish_check.rc > 0
1117

1218
- name: Update apt cache
1319
apt:
1420
update_cache: true
21+
when:
22+
- fish_check.rc > 0
1523

1624
- name: Install fish
1725
apt:
1826
name: fish
1927
state: latest
2028
update_cache: true
21-
cache_valid_time: 600
29+
cache_valid_time: 600
30+
when:
31+
- fish_check.rc > 0

roles/mosh/tasks/install/go.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
- name: Check if golang is installed
3+
shell: test -e {{ mosh_golang_location }}
4+
register: golang_check
5+
failed_when: golang_check.rc == 2
6+
become: yes
7+
become_user: "{{ mosh_system_user }}"
8+
9+
- name: Download golang
10+
get_url:
11+
url: '{{ mosh_golang_download_url }}'
12+
dest: '{{ mosh_golang_download_location }}'
13+
become: yes
14+
become_user: "{{ mosh_system_user }}"
15+
when:
16+
- golang_check.rc > 0
17+
18+
- name: Install golang
19+
unarchive:
20+
src: '{{ mosh_golang_download_location }}'
21+
dest: '{{ mosh_golang_extract_location }}'
22+
become: True
23+
become_user: root
24+
when:
25+
- golang_check.rc > 0

roles/mosh/tasks/install/node.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
- name: Check if node is installed
3+
shell: test -e {{ mosh_node_location }}
4+
register: node_check
5+
failed_when: node_check.rc == 2
6+
become: yes
7+
become_user: "{{ mosh_system_user }}"
8+
9+
- name: Download node
10+
shell: curl -sL https://deb.nodesource.com/setup_{{ mosh_node_version }} | sudo -E bash -
11+
become: True
12+
become_user: root
13+
args:
14+
warn: no
15+
when:
16+
- node_check.rc > 0
17+
18+
- name: Update apt cache
19+
apt:
20+
update_cache: true
21+
when:
22+
- node_check.rc > 0
23+
24+
- name: Install nodejs
25+
apt:
26+
name: nodejs
27+
state: latest
28+
update_cache: true
29+
cache_valid_time: 600
30+
when:
31+
- node_check.rc > 0
32+
33+
- name: Check if n is installed
34+
shell: test -e {{ mosh_node_location }}
35+
register: n_check
36+
failed_when: n_check.rc == 2
37+
become: yes
38+
become_user: "{{ mosh_system_user }}"
39+
40+
- name: Install n
41+
npm:
42+
name: 'n'
43+
global: yes
44+
become: True
45+
become_user: root
46+
when:
47+
- n_check.rc > 0

roles/mosh/tasks/install/python.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
22
- name: Add python PPA
3-
apt_repository:
4-
repo: "{{ mosh_python_ppa }}"
5-
state: present
6-
become: true
3+
shell: add-apt-repository {{ mosh_python_ppa }} -y
4+
become: yes
75
become_user: root
86
when:
97
- mosh_python_ppa is defined
@@ -19,4 +17,4 @@
1917
state: latest
2018
update_cache: true
2119
cache_valid_time: 600
22-
loop: '{{ mosh_python_versions }}'
20+
loop: '{{ mosh_python_versions }}'

roles/mosh/tasks/install/spotify.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
- name: Check if spotify is installed
3+
shell: test -e {{ mosh_spotify_location }}
4+
register: spotify_check
5+
failed_when: spotify_check.rc == 2
6+
become: yes
7+
become_user: "{{ mosh_system_user }}"
8+
9+
- name: Add spotify apt key
10+
shell: curl -sS {{ mosh_spotify_download_url }} | sudo apt-key add -
11+
become: True
12+
become_user: root
13+
args:
14+
warn: no
15+
when:
16+
- spotify_check.rc > 0
17+
18+
- name: Add spotify to sources
19+
shell: echo "deb {{ mosh_spotify_repository_url }} stable non-free" | sudo tee {{ mosh_spotify_sources_list }}
20+
become: True
21+
become_user: root
22+
when:
23+
- spotify_check.rc > 0
24+
25+
- name: Update apt cache
26+
apt:
27+
update_cache: true
28+
when:
29+
- spotify_check.rc > 0
30+
31+
- name: Install spotify
32+
apt:
33+
name: spotify-client
34+
state: latest
35+
update_cache: true
36+
cache_valid_time: 600
37+
when:
38+
- spotify_check.rc > 0

roles/mosh/tasks/install/yarn.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
- name: Check if yarn is installed
3+
shell: test -e {{ mosh_yarn_location }}
4+
register: yarn_check
5+
failed_when: yarn_check.rc == 2
6+
become: yes
7+
become_user: "{{ mosh_system_user }}"
8+
9+
- name: Add yarn apt key
10+
shell: curl -sL {{ mosh_yarn_download_url }} | sudo apt-key add -
11+
become: True
12+
become_user: root
13+
args:
14+
warn: no
15+
when:
16+
- yarn_check.rc > 0
17+
18+
- name: Add yarn to sources
19+
shell: echo "deb {{ mosh_yarn_sources_url }} stable main" | sudo tee {{ mosh_yarn_sources_list }}
20+
become: True
21+
become_user: root
22+
when:
23+
- yarn_check.rc > 0
24+
25+
- name: Update apt cache
26+
apt:
27+
update_cache: true
28+
when:
29+
- yarn_check.rc > 0
30+
31+
- name: Install yarn
32+
apt:
33+
name: yarn
34+
state: latest
35+
update_cache: true
36+
cache_valid_time: 600
37+
when:
38+
- yarn_check.rc > 0

0 commit comments

Comments
 (0)