-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision_ssh_keys.yml
43 lines (38 loc) · 1.12 KB
/
provision_ssh_keys.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
- name: provision ssh keys
hosts: "all"
become: yes
tasks:
- name: Check if provision user exists for this server
stat:
path: /home/provision
register: folder
- name: Write ssh authorized keys for provision user
template:
src: "../templates/authorized_keys.j2"
dest: "/home/provision/.ssh/authorized_keys"
owner: provision
group: provision
mode: 0600
when: folder.stat.exists
- name: Check if deploy user exists for this server
stat:
path: /home/deploy
register: folder
- name: Write ssh authorized keys for deploy user
template:
src: "../templates/authorized_keys.j2"
dest: "/home/deploy/.ssh/authorized_keys"
owner: deploy
group: deploy
mode: 0600
when: folder.stat.exists
# - name: Check if php is installed
# shell: "which php"
# register: is_php_installed
# failed_when: false
#
# - name: Add the deb.sury.org trusted key
# apt_key:
# id: 95BD4743
# url: https://packages.sury.org/php/apt.gpg
# when: is_php_installed.rc == 0