ansible/tasks/drbackupkey.yml
Patrick Uiterwijk 7c787c2989 Move the drbackup homedir to /home
This is one way to make sure we adhere to: uid < 1000 || homedir in /home
2015-03-12 13:41:42 +00:00

21 lines
806 B
YAML

---
- name: ensure the drbackup group exists
group: name=drbackup state=present
# Do not move the homedir outside of /home, since either this or uid < 1000 is required
- name: ensure the drbackup user exists
user: name=drbackup comment="DR Backup User" group=drbackup shell=/bin/bash home=/home/drbackup
- name: Make sure the drbackup homedir exists
file: dest=/home/drbackup/ state=directory owner=drbackup group=drbackup mode=0700
- name: install the authorized SSH key
file: dest=/home/drbackup/.ssh/ state=directory owner=drbackup group=drbackup mode=0700
- name: install the backup ssh keys
copy: src={{private}}/files/backup.pub dest=/home/drbackup/.ssh/authorized_keys owner=drbackup group=drbackup mode=0600
#
# deploy the confine-ssh script
#
- include: "{{tasks}}/confine_ssh.yml"