-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
96 lines (85 loc) · 2.38 KB
/
playbook.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
- name: User setup
hosts: all
become: true
tasks:
- name: Add user mahyuddin
user:
name: mahyuddin
comment: Mahyuddin Susanto
shell: /bin/bash
- name: Add authorized_keys
authorized_key:
user: mahyuddin
state: present
key: https://github.com/udienz.keys
- name: Update database and upgrade packages
ansible.builtin.apt:
update_cache: yes
upgrade: yes
cache_valid_time: 86400
autoremove: yes
autoclean: yes
- name: Install packages
ansible.builtin.package:
pkg: "{{ item }}"
state: latest
with_items:
- sudo
- vim
- htop
- iftop
- byobu
- git
- bind9-utils
- bind9-host
- whois
- bash-completion
- less
- mtr-tiny
- rsync
- curl
- inetutils-traceroute
- inetutils-ping
- apt-transport-https
- python3-minimal
- gnupg2
- name: Add to sudoers
lineinfile:
path: /etc/sudoers.d/mahyuddin
line: 'mahyuddin ALL = NOPASSWD: ALL'
state: present
mode: 0400
create: yes
validate: 'visudo -cf %s'
- name: Set timezone
community.general.timezone:
name: Asia/Jakarta
- name: Update sensible editor
community.general.alternatives:
name: editor
path: /usr/bin/vim.basic
- name: Disable unnecessary multipathd service
ansible.builtin.systemd:
state: stopped
enabled: no
name: multipathd.service
- name: Disable unnecessary multipathd socket
ansible.builtin.systemd:
state: stopped
enabled: no
name: multipathd.socket
- name: Disable unnecessary snapd service
ansible.builtin.systemd:
state: stopped
enabled: no
name: snapd.socket
- name: Disable unnecessary snapd socket
ansible.builtin.systemd:
state: stopped
enabled: no
name: snapd.service
- name: Change editor to Vim
community.general.alternatives:
name: editor
path: /usr/bin/vim.basic