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