Skip to content

Commit

Permalink
feat(ansible): add envs to local user .bashrc (autowarefoundation#4923)
Browse files Browse the repository at this point in the history
* feat(ansible): add envs to local user .bashrc

Signed-off-by: Amadeusz Szymko <[email protected]>

* fix(ansible): set root privileges

Signed-off-by: amadeuszsz <[email protected]>

---------

Signed-off-by: Amadeusz Szymko <[email protected]>
Signed-off-by: amadeuszsz <[email protected]>
  • Loading branch information
amadeuszsz authored Aug 1, 2024
1 parent 4cfa28a commit 811a840
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
9 changes: 9 additions & 0 deletions ansible/roles/build_tools/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
create: true
mode: 0644

- name: Add CCACHE_DIR to .bashrc of local user
become: true
ansible.builtin.lineinfile:
dest: /etc/skel/.bashrc
line: export CCACHE_DIR="$HOME/.ccache"
state: present
create: true
mode: 0644

- name: Export CC to ccache
ansible.builtin.lineinfile:
dest: ~/.bashrc
Expand Down
12 changes: 10 additions & 2 deletions ansible/roles/cuda/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,28 @@
when: cuda_install_drivers | bool

- name: Add PATH to .bashrc
become: true
ansible.builtin.lineinfile:
dest: ~/.bashrc
dest: "{{ item }}"
line: export PATH="/usr/local/cuda/bin:$PATH"
state: present
create: true
mode: 0644
loop:
- ~/.bashrc
- /etc/skel/.bashrc

- name: Add LD_LIBRARY_PATH to bashrc
become: true
ansible.builtin.lineinfile:
dest: ~/.bashrc
dest: "{{ item }}"
line: export LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
state: present
create: true
mode: 0644
loop:
- ~/.bashrc
- /etc/skel/.bashrc

- name: Create Vulkan directory
become: true
Expand Down
6 changes: 5 additions & 1 deletion ansible/roles/rmw_implementation/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
when: not install_result.changed

- name: Add RMW_IMPLEMENTATION to .bashrc
become: true
ansible.builtin.lineinfile:
dest: ~/.bashrc
dest: "{{ item }}"
line: export RMW_IMPLEMENTATION={{ rmw_implementation }}
state: present
create: true
mode: 0644
loop:
- ~/.bashrc
- /etc/skel/.bashrc
6 changes: 5 additions & 1 deletion ansible/roles/ros2/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@
when: not install_result.changed

- name: Add PATH to .bashrc
become: true
ansible.builtin.lineinfile:
dest: ~/.bashrc
dest: "{{ item }}"
line: source /opt/ros/{{ rosdistro }}/setup.bash
state: present
create: true
mode: 0644
loop:
- ~/.bashrc
- /etc/skel/.bashrc

0 comments on commit 811a840

Please sign in to comment.