Browse Source

Ensure $HOME dir exists and has the right owner/group

This changes adds an additional task to make sure the
output of the useradd module is consistent when the
HOME dir for a given user is created.
In particular this tasks ensure the HOME dir has the
right owner/group associated to the user that has been
created.

Closes-Bug: #1917856
Change-Id: I64846594123b9d5f333082b3f7714186713caffb
changes/24/778624/4
Francesco Pantano 1 year ago
parent
commit
7e67d35c3d
No known key found for this signature in database
GPG Key ID: 458D4D1F41BD75C
  1. 1
      tripleo_ansible/playbooks/cli-enable-ssh-admin.yaml
  2. 9
      tripleo_ansible/roles/tripleo_create_admin/tasks/create_user.yml

1
tripleo_ansible/playbooks/cli-enable-ssh-admin.yaml

@ -78,6 +78,7 @@
state: directory
mode: "0700"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
become: true
- name: Ensure ssh key pair

9
tripleo_ansible/roles/tripleo_create_admin/tasks/create_user.yml

@ -27,6 +27,15 @@
{{ tripleo_admin_user }} ALL=(ALL) NOPASSWD:ALL
mode: 0440
# workaround for https://bugs.launchpad.net/tripleo/+bug/1917856
- name: ensure home dir has the right owner/group for user {{ tripleo_admin_user }}
file:
path: /home/{{ tripleo_admin_user }}
state: directory
owner: '{{ tripleo_admin_user }}'
group: '{{ tripleo_admin_user }}'
mode: 0700
- name: ensure .ssh dir exists for user {{ tripleo_admin_user }}
file:
path: /home/{{ tripleo_admin_user }}/.ssh

Loading…
Cancel
Save