Skip to content

Commit

Permalink
[BACKPORT 2.20.0][PLAT-10930] Permissions issue when creating yugabyt…
Browse files Browse the repository at this point in the history
…e bash_profile

Summary:
Original commit: fa9abf5 / D29614
On certain OS's when we create a user the bash_profile is not automatically created for that user.
Thus, when Ansible creates it, because we don't explicitly set the owner/group it is owned by root
and then throws permission errors whenever yugabyte user actually tries to read/execute the file.
This diff explicitly sets the ownership of the right files in case they are created.

Test Plan: universe creation on SLES

Reviewers: amalyshev, nbhatia

Reviewed By: nbhatia

Subscribers: yugaware

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D31046
  • Loading branch information
shubin-yb committed Dec 14, 2023
1 parent 37113fc commit eef6718
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions managed/devops/roles/provision-cluster-server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,17 @@
lineinfile:
dest: "{{ yb_home_dir }}/.bash_profile"
line: ". {{ yb_home_dir }}/.bashrc"
owner: "{{ user_name }}"
group: "{{ user_name }}"
create: yes
state: present

- name: Export XDG_RUNTIME_DIR for yb user
lineinfile:
dest: "{{ yb_home_dir }}/.bashrc"
line: "export XDG_RUNTIME_DIR=/run/user/{{ output.stdout }}"
owner: "{{ user_name }}"
group: "{{ user_name }}"
create: yes
state: present

Expand Down

0 comments on commit eef6718

Please sign in to comment.