Allow customization of deploy username

This commit is contained in:
Joshua Boniface 2021-04-13 11:30:42 -04:00 committed by Joshua Boniface
parent 593a81e07c
commit ce3554b530
2 changed files with 9 additions and 7 deletions

View File

@ -0,0 +1,2 @@
---
deploy_username: "deploy"

View File

@ -612,11 +612,11 @@
# deploy
- name: ensure user deploy exists
user:
name: deploy
name: "{{ deploy_username }}"
uid: 200
group: operator
shell: /bin/bash
home: /var/home/deploy
home: "/var/home/{{ deploy_username }}"
createhome: yes
move_home: yes
state: present
@ -625,25 +625,25 @@
- name: ensure homedir has right permissions
file:
dest: /var/home/deploy
dest: "/var/home/{{ deploy_username }}"
state: directory
owner: deploy
owner: "{{ deploy_username }}"
group: operator
mode: 0700
tags: users
- name: ensure .ssh directory exists
file:
dest: /var/home/deploy/.ssh
dest: "/var/home/{{ deploy_username }}/.ssh"
state: directory
owner: deploy
owner: "{{ deploy_username }}"
group: operator
mode: 0700
tags: users
- name: add authorized keys
authorized_key:
user: "deploy"
user: "{{ deploy_username }}"
key: "{{ item.1 }}"
with_subelements:
- "{{ admin_users }}"