You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
41 lines
1.0 KiB
3 years ago
|
---
|
||
|
- name: jekyll_site | Deploy User | Ensure deploy group exists
|
||
|
group:
|
||
|
name: "{{ deploy_group }}"
|
||
|
state: present
|
||
|
become: yes
|
||
|
|
||
|
- name: jekyll_site | Deploy User | Allow deploy group to have passwordless sudo
|
||
|
lineinfile:
|
||
|
dest: /etc/sudoers
|
||
|
state: present
|
||
|
regexp: '^%{{ deploy_group }}'
|
||
|
line: '%{{ deploy_group }} ALL=(ALL) NOPASSWD: ALL'
|
||
|
validate: 'visudo -cf %s'
|
||
|
become: yes
|
||
|
|
||
|
- name: jekyll_site | Deploy User | Ensure deploy user exists.
|
||
|
user:
|
||
|
name: "{{ deploy_user }}"
|
||
|
group: "{{ deploy_group }}"
|
||
|
state: present
|
||
|
create_home: yes
|
||
|
shell: /bin/bash
|
||
|
become: yes
|
||
|
|
||
|
- name: jekyll_site | Deploy User | Ensure admin user ssh directory exists
|
||
|
file:
|
||
|
path: "/home/{{ deploy_user }}/.ssh/"
|
||
|
state: directory
|
||
|
owner: "{{ deploy_user }}"
|
||
|
group: "{{ deploy_group }}"
|
||
|
mode: 0700
|
||
|
become: yes
|
||
|
|
||
|
- name: jekyll_site | Deploy User | Add SSH keys to admin user
|
||
|
authorized_key:
|
||
|
user: "{{ deploy_user }}"
|
||
|
state: present
|
||
|
key: "{{ item.key }}"
|
||
|
with_items: "{{ ssh__keys }}"
|
||
|
become: yes
|