File tree 3 files changed +61
-4
lines changed
3 files changed +61
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ - hosts : all
4
+ become : true
5
+ pre_tasks :
6
+
7
+ - name : install updates (CentOS)
8
+ tags : always
9
+ dnf :
10
+ update_only : yes
11
+ update_cache : yes
12
+ when : ansible_distribution == "CentOS"
13
+
14
+ - name : install updates (Ubuntu)
15
+ tags : always
16
+ apt :
17
+ upgrade : dist
18
+ update_cache : yes
19
+ when : ansible_distribution == "Ubuntu"
20
+
21
+
22
+ - hosts : all
23
+ become : true
24
+ tasks :
25
+
26
+ - name : create simone user
27
+ tags : always
28
+ user :
29
+ name : simone
30
+ groups : root
31
+
32
+ - name : add ssh key for simone
33
+ tags : always
34
+ authorized_key :
35
+ user : simone
36
+ key : " ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDDFKXMIafzQFacLs0RyQoeTvjFrtR4R2FIlOsvQXOfg ansible"
37
+
38
+ - name : add sudoers file for simone
39
+ tags : always
40
+ copy :
41
+ src : sudoer_simone
42
+ dest : /etc/sudoers.d/simone
43
+ owner : root
44
+ group : root
45
+ mode : 0440
Original file line number Diff line number Diff line change
1
+ simone ALL=(ALL) NOPASSWD: ALL
Original file line number Diff line number Diff line change 4
4
become : true
5
5
pre_tasks :
6
6
7
- - name : install updates (CentOS)
7
+ - name : update repo cache (CentOS)
8
8
tags : always
9
9
dnf :
10
- update_only : yes
11
10
update_cache : yes
11
+ changed_when : false
12
12
when : ansible_distribution == "CentOS"
13
13
14
- - name : install updates (Ubuntu)
14
+ - name : update repo cache (Ubuntu)
15
15
tags : always
16
16
apt :
17
- upgrade : dist
18
17
update_cache : yes
18
+ changed_when : false
19
19
when : ansible_distribution == "Ubuntu"
20
20
21
21
22
+ - hosts : all
23
+ become : true
24
+ tasks :
25
+
26
+ - name : add ssh key for simone
27
+ tags : always
28
+ authorized_key :
29
+ user : simone
30
+ key : " ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDDFKXMIafzQFacLs0RyQoeTvjFrtR4R2FIlOsvQXOfg ansible"
31
+
32
+
22
33
- hosts : workstations
23
34
become : true
24
35
tasks :
You can’t perform that action at this time.
0 commit comments