This repository has been archived by the owner on Jul 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
147 additions
and
118 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
- name: Verify Ansible version | ||
assert: | ||
that: "ansible_version.full is version_compare('2.9', '>=')" | ||
fail_msg: This Ansible playbook requires Ansible version >= 2.9.1. Current version is {{ ansible_version.full }} | ||
quiet: yes | ||
- name: Enable third-party sources | ||
lineinfile: | ||
path: /etc/apt/sources.list | ||
regexp: '^#\s?(deb\s{1,}.*partner)$' | ||
line: '\g<1>' | ||
backrefs: yes | ||
- name: Update repos and upgrade all packages | ||
apt: | ||
update_cache: yes | ||
upgrade: safe | ||
force_apt_get: yes | ||
- name: Install fish shell | ||
apt: | ||
name: fish | ||
force_apt_get: yes | ||
- name: Set current user's default shell to fish | ||
user: | ||
name: "{{ ansible_user }}" | ||
shell: /usr/bin/fish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- name: Add asdf java plugin | ||
shell: . ~/.bashrc && asdf plugin add java | ||
register: add_plugin | ||
failed_when: add_plugin.rc == 1 | ||
changed_when: add_plugin.rc == 0 | ||
|
||
- name: Install AdoptOpenJDK 8, 11 and 14 | ||
shell: > | ||
set -o pipefail && \ | ||
source ~/.bashrc && asdf latest java {{ item }} | xargs -i sh -c '. ~/.bashrc && asdf install java {}' | ||
args: | ||
executable: /bin/bash | ||
register: install_other_java | ||
failed_when: | ||
- install_other_java.rc != 0 | ||
- '"is already installed" not in install_other_java.stdout' | ||
changed_when: install_other_java.rc == 0 | ||
loop: | ||
- adoptopenjdk-8 | ||
- adoptopenjdk-11 | ||
- adoptopenjdk-14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
- name: Check if asdf is already installed | ||
stat: | ||
path: ~/.asdf | ||
register: asdf | ||
|
||
- name: Download asdf | ||
git: | ||
repo: https://github.com/asdf-vm/asdf.git | ||
dest: ~/.asdf | ||
version: "{{ version }}" | ||
when: not asdf.stat.exists | ||
|
||
- name: Create fish directory if missing | ||
file: | ||
path: ~/.config/fish | ||
state: directory | ||
|
||
- name: Add asdf to config.fish | ||
lineinfile: | ||
path: ~/.config/fish/config.fish | ||
line: "source ~/.asdf/asdf.fish" | ||
create: yes | ||
|
||
- name: Create fish completions directory if missing | ||
file: | ||
path: ~/.config/fish/completions | ||
state: directory | ||
|
||
- name: Check if fish completions need to be set up | ||
stat: | ||
path: ~/.config/fish/completions/asdf.fish | ||
register: completions | ||
|
||
- name: Set up fish completions | ||
command: cp ~/.asdf/completions/asdf.fish ~/.config/fish/completions | ||
args: | ||
executable: /bin/bash | ||
when: not completions.stat.exists | ||
|
||
- name: Add asdf to bashrc | ||
blockinfile: | ||
path: ~/.bashrc | ||
marker: "# {mark} ANSIBLE MANAGED BLOCK (asdf)" | ||
block: | | ||
. ~/.asdf/asdf.sh | ||
. ~/.asdf/completions/asdf.bash | ||
- name: Set up Java | ||
import_tasks: java.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
packages: | ||
- chromium-browser | ||
- curl | ||
- fish | ||
- flashplugin-installer | ||
- flatpak | ||
- fzf | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
dependencies: | ||
- role: asdf # noqa 701 | ||
vars: | ||
version: v0.8.0 | ||
become: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
- name: Set AdoptOpenJDK 14 as default version | ||
shell: > | ||
set -o pipefail && \ | ||
source ~/.bashrc && asdf latest java adoptopenjdk-14 \ | ||
| xargs -i sh -c '. ~/.bashrc && asdf install java {} && asdf global java {}' | ||
args: | ||
executable: /bin/bash | ||
register: set_default_java | ||
failed_when: | ||
- set_default_java.rc != 0 | ||
- '"is already installed" not in set_default_java.stdout' | ||
changed_when: set_default_java.rc == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
adoptopenjdk14: | ||
version: 14.0.2.hs-adpt | ||
|
||
docker_compose: | ||
version: 1.27.2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
dependencies: | ||
- role: asdf # noqa 701 | ||
vars: | ||
version: v0.8.0 | ||
become: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
- name: Set AdoptOpenJDK 11 as default version | ||
shell: > | ||
set -o pipefail && \ | ||
source ~/.bashrc && asdf latest java adoptopenjdk-11 \ | ||
| xargs -i sh -c '. ~/.bashrc && asdf install java {} && asdf global java {}' | ||
args: | ||
executable: /bin/bash | ||
register: set_default_java | ||
failed_when: | ||
- set_default_java.rc != 0 | ||
- '"is already installed" not in set_default_java.stdout' | ||
changed_when: set_default_java.rc == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.