diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2019-02-22 16:55:47 +0530 |
---|---|---|
committer | Valerii Ponomarov <vponomar@redhat.com> | 2019-02-22 16:55:47 +0530 |
commit | a53105e63e02e9594587f188aca75b6121ec8a23 (patch) | |
tree | aaa52aedf3b80d43fabb033105b1eaf1d8542ad7 | |
parent | eb396cc001519bfc3d27061a81a7cbf0692e4853 (diff) |
[Deployment] Fix CRS deployment for non-root users
User's home dir in CRS logic was hardcoded as "root".
So, fix it by calculating home dir of the current user.
Change-Id: Ib586fa605390126eb3a2efaf8c93856e52676aaf
-rw-r--r-- | deployment/playbooks/crs-setup.yaml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/deployment/playbooks/crs-setup.yaml b/deployment/playbooks/crs-setup.yaml index abe59eff..ea84a27e 100644 --- a/deployment/playbooks/crs-setup.yaml +++ b/deployment/playbooks/crs-setup.yaml @@ -25,9 +25,12 @@ - hosts: localhost ignore_errors: no tasks: + - name: Get home dir of the current user + shell: "getent passwd $(whoami) | cut -d: -f6" + register: user_home_dir - name: Define path for the SSH key set_fact: - crs_ssh_keypath: "/root/.ssh/crs_nodes_{{ + crs_ssh_keypath: "{{ user_home_dir.stdout_lines[0].strip() }}/.ssh/crs_nodes_{{ cluster_id + '_' + (999999999999999 | random | string ) }}" - name: Generate SSH key pair for Heketi and CRS interactions shell: "yes y| ssh-keygen -b 2048 -t rsa -f {{ crs_ssh_keypath }} -q -N ''" |