-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.yml
50 lines (43 loc) · 1004 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
48
49
---
- hosts: all
become: true
pre_tasks:
- name: install updates (Alma Linux)
tags: always
dnf:
update_only: yes
update_cache: yes
when: ansible_distribution == "AlmaLinux"
- name: install updates (Centos)
tags: always
dnf:
update_only: yes
update_cache: yes
when: ansible_distribution == "CentOS"
- name: install updates (Ubuntu)
tags: always
apt:
upgrade: dist
update_cache: 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 AAAAC3NzaC1lZDI1NTE5AAAAIMAn3oWEjSIMU4uGRqnxe9dxcJFXzuw6LI/rQ04gT6ZQ ansible"
- name: add sudoers file for simone
tags: always
copy:
src: sudoer_simone
dest: /etc/sudoers.d/simone
owner: root
group: root
mode: 0440