From 146298a5da704f995b21e57dad1e920a22307970 Mon Sep 17 00:00:00 2001 From: Chris Hines <chris.hines@monash.edu> Date: Wed, 12 Aug 2015 06:36:09 +0000 Subject: [PATCH] make move_homdir work on CentOS7 as well, in which case ec2-user has a different uidNumber --- roles/move_homedir/tasks/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/move_homedir/tasks/main.yml b/roles/move_homedir/tasks/main.yml index ffdba30..b30a67c 100644 --- a/roles/move_homedir/tasks/main.yml +++ b/roles/move_homedir/tasks/main.yml @@ -29,3 +29,13 @@ sudo: true register: edit2 +- name: edit passwd file + lineinfile: + args: + dest: /etc/passwd + regexp: "{{ ansible_ssh_user }}:x:1000:1000::/home/{{ ansible_ssh_user }}:.*" + line: "{{ ansible_ssh_user }}:x:1000:1000::/local_home/{{ ansible_ssh_user }}:/bin/bash" + backrefs: yes + sudo: true + register: edit3 + -- GitLab