From 9cfe62ca1863aefc9f8f4ba21bbb197813b2acb0 Mon Sep 17 00:00:00 2001 From: Thom Toogood Date: Wed, 1 Jun 2016 07:44:43 +1000 Subject: [PATCH] Add ssh_home var as default pwd for SSH. --- default.config.yml | 1 + provisioning/tasks/sshd.yml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/default.config.yml b/default.config.yml index 3681e7b38..05269d7a1 100644 --- a/default.config.yml +++ b/default.config.yml @@ -292,3 +292,4 @@ selenium_version: 2.46.0 # Other configuration. dashboard_install_dir: /var/www/dashboard known_hosts_path: ~/.ssh/known_hosts +#ssh_home: "{{ drupal_core_path }}" diff --git a/provisioning/tasks/sshd.yml b/provisioning/tasks/sshd.yml index be492d667..2006c2f59 100644 --- a/provisioning/tasks/sshd.yml +++ b/provisioning/tasks/sshd.yml @@ -19,3 +19,13 @@ mode: 0644 become: no when: known_hosts_file.stat.exists + +- name: Set SSH home directory. + lineinfile: + dest: "/home/{{ drupalvm_user }}/.bashrc" + state: present + create: yes + regexp: "^SSH_HOME=" + line: "SSH_HOME={{ ssh_home }} && [ -e $SSH_HOME ] && cd $SSH_HOME" + become: no + when: ssh_home is defined