summaryrefslogtreecommitdiff
path: root/roles/base/tasks/main.yaml
blob: 17b057810629e1cf37de4ee90fed2acb9afa66f3 (plain) (blame)
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
---
- name: disable recommends and suggests
  copy:
    src: 02no-recommends
    dest: /etc/apt/apt.conf.d/

- name: install base system tools
  apt:
    name: "{{ item }}"
    state: present
  with_items:
  - htop
  - dstat
  - lsof
  - gawk
  - psmisc
  - less
  - debian-goodies
  - screen
  - mtr-tiny
  - tcpdump
  - iptraf-ng
  - unp
  - haveged
  - dbus
  - libpam-systemd
  - aptitude
  - ca-certificates
  - file
  - man-db
  - manpages

- name: Remove startup message from screen
  lineinfile:
    regexp: "^startup_message"
    line: "startup_message off"
    dest: /etc/screenrc
    mode: 0644
  tags:
  - screen

- name: install htop config (1/2)
  with_items:
  - /root
  - /etc/skel
  file:
    name: "{{ item }}/.config/htop/"
    state: directory
    mode: 0700

- name: install htop config (2/2)
  with_items:
  - /root
  - /etc/skel
  copy:
    src: htoprc
    dest: "{{ item }}/.config/htop/"

- name: Ensure /root is not world accessible
  file:
    path: /root
    mode: 0700
    owner: root
    group: root
    state: directory

- name: disable net/fs/misc kernel modules
  lineinfile:
    dest: /etc/modprobe.d/disablemod.conf
    line: "install {{ item }} /bin/true"
    create: yes
    owner: root
    group: root
    mode: 0644
  with_items: "{{ modules_blacklist.net | union(modules_blacklist.fs) | union(modules_blacklist.misc) }}"

- name: Change various sysctl-settings, look at the sysctl-vars file for documentation
  sysctl:
    name: "{{ item.key }}"
    value: "{{ item.value }}"
    sysctl_set: yes
    state: present
    reload: yes
    ignoreerrors: yes
  with_dict: "{{ sysctl_config | combine(sysctl_config_user) }}"

- name: install extra packages
  apt:
    name: "{{ base_packages_extra_host | union(base_packages_extra_group) }}"
    state: present