Modify environment variables for Flutter, Android, and Java.

This commit is contained in:
me committed 2026-10-22 08:42:00 -07:00
1 parent c852329455
commit ed8a33e00c
3 files changed
+51 -59

No files matched your search

+3 -36
View File
@@ -397,47 +397,13 @@
## Configure Environment ##
- name: Workstation | Linux | Software | Android | Modify PATH (.bashrc)
ansible.builtin.blockinfile:
path: "{{ item }}/.bashrc"
block: |
export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}"
marker: '# {mark} MANAGED BY ANSIBLE | Android'
state: absent
create: true
backup: true
mode: "0755"
loop:
- "{{ user_root.home }}"
- "{{ user_user.home }}"
when: coding
and user_root.home != ""
and user_user.home != ""
- name: Workstation | Linux | Software | Android | Modify PATH (.zshrc)
ansible.builtin.blockinfile:
path: "{{ item }}/.zshrc"
block: |
export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}"
marker: '# {mark} MANAGED BY ANSIBLE | Android'
state: absent
create: true
backup: true
mode: "0755"
loop:
- "{{ user_root.home }}"
- "{{ user_user.home }}"
when: coding
and user_root.home != ""
and user_user.home != ""
- name: Workstation | Linux | Software | Flutter | Modify PATH (profiles)
- name: Workstation | Linux | Software | Android | Modify PATH (profiles)
ansible.builtin.blockinfile:
path: "{{ user_user.home }}/{{ item }}"
block: |
export ANDROID_HOME="{{ android_sdk_location }}"
export ANDROID_SDK_ROOT="$ANDROID_HOME"
export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}"
export PATH="{{ android_bin_location }}:{{ android_sdk_cmdline_final }}:$PATH"
marker: '# {mark} MANAGED BY ANSIBLE | Android'
state: present
create: true
@@ -446,6 +412,7 @@
loop:
- ".bash_profile"
- ".zprofile"
- ".profile"
when: coding
and user_user.home != ""
+2 -1
View File
@@ -166,7 +166,7 @@
ansible.builtin.blockinfile:
path: "{{ user_user.home }}/{{ item }}"
block: |
export PATH="$PATH:{{ flutter_bin_location }}"
export PATH="{{ flutter_bin_location }}:$PATH"
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
state: present
create: true
@@ -175,6 +175,7 @@
loop:
- ".bash_profile"
- ".zprofile"
- ".profile"
when: coding
and user_user.home != ""
+46 -22
View File
@@ -5,31 +5,55 @@
- name: Workstation | Linux | Software | Java | pacman
block:
- name: Workstation | Linux | Software | Java | pacman | Facts
ansible.builtin.set_fact:
jdk_version: 21
jdk_dir: ~/SDKs/Java
- name: Workstation | Linux | Software | Java | pacman | Facts
ansible.builtin.set_fact:
jdk_version: 21
jdk_src: /usr/lib/jvm/default
jdk_dir: ~/SDKs/Java
jdk_path: ~/SDKs/Java/bin
- name: Workstation | Linux | Software | Java | pacman | Install
ansible.builtin.package:
name:
- "jdk{{ item }}-openjdk"
state: present
loop:
- "{{ jdk_version }}"
- 25
- 21
- 17
- name: Workstation | Linux | Software | Java | pacman | Install
ansible.builtin.package:
name:
- "jdk{{ item }}-openjdk"
state: present
loop:
- "{{ jdk_version }}"
- 25
- 21
- 17
- name: Workstation | Linux | Software | Java | pacman | Set
ansible.builtin.shell: "archlinux-java set java-{{ jdk_version }}-openjdk"
- name: Workstation | Linux | Software | Java | pacman | Set
ansible.builtin.shell: "archlinux-java set java-{{ jdk_version }}-openjdk"
register: shell_check
changed_when: shell_check.rc == 0
- name: Workstation | Linux | Software | Java | pacman | Link
ansible.builtin.shell: "ln -sf /usr/lib/jvm {{ jdk_dir }}"
args:
creates: "{{ jdk_dir }}"
become: true
become_user: "{{ user }}"
- name: Workstation | Linux | Software | Java | pacman | Link
ansible.builtin.file:
src: "{{ jdk_src }}"
dest: "{{ jdk_dir }}"
state: link
become: true
become_user: "{{ user }}"
- name: Workstation | Linux | Software | Java | Modify PATH (profiles)
ansible.builtin.blockinfile:
path: "{{ user_user.home }}/{{ item }}"
block: |
export JAVA_HOME="{{ jdk_dir }}"
export JAVA_PATH="{{ jdk_path }}"
export PATH="$JAVA_PATH:$PATH
marker: '# {mark} MANAGED BY ANSIBLE | Java'
state: present
create: true
backup: true
mode: "0755"
loop:
- ".bash_profile"
- ".zprofile"
- ".profile"
when: coding
and user_user.home != ""
when: coding is true
and ansible_pkg_mgr == "pacman"