-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.yml
49 lines (38 loc) · 886 Bytes
/
bootstrap.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
44
45
46
47
---
- hosts: all
become: true
pre_tasks:
- name: install updates (Ubuntu)
tags: always
apt:
upgrade: dist
update_cache: yes
when: ansible_distribution == "Ubuntu"
- name: enable ssh connections for remote management
tags: ssh
service:
name: ssh
state: started
enabled: yes
when: ansible_distribution == "Ubuntu"
- hosts: all
become: true
tasks:
- name: create simone user
tags: always
user:
name: simone
groups: root
- name: add ssh key for simone
tags: always
authorized_key:
user: simone
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICTTmXLRpS7fAL0V66jTPPkgxGdM4M7Fd5iqRJWDdpdr rlansible"
- name: add sudoers file for simone
tags: always
copy:
src: sudoer_simone
dest: /etc/sudoers.d/simone
owner: root
group: root
mode: 0440