summaryrefslogtreecommitdiff
path: root/roles/vm/guest/tasks/main.yml
blob: 4830d05117a97c11a0b13ba71339529da816ff31 (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
- name: Install rngd
  apt:
    name: rng-tools
    state: present

- name: Configure rngd [1/2]
  lineinfile:
    path: /etc/default/rng-tools
    line: '{{ item.key }}={{ item.value }}'
    regexp: '^#?{{ item.key }}='
  with_dict: '{{ rngd_config }}'
  loop_control:
    label: "{{ item.key }}"
  notify: restart rngd

- name: Configure rngd [2/2]
  lineinfile:
    path: /etc/default/rng-tools
    regexp: '^{{ item.key }}=(?!{{ item.value }})'
    state: absent
  with_dict: '{{ rngd_config }}'
  loop_control:
    label: "{{ item.key }}"
  notify: restart rngd

- name: Provide a root shell on the VM console [1/2]
  file:
    path: /etc/systemd/system/serial-getty@ttyS0.service.d/
    state: directory

- name: Provide a root shell on the VM console [2/2]
  copy:
    dest: /etc/systemd/system/serial-getty@ttyS0.service.d/autologon.conf
    content: |
      [Service]
      ExecStart=
      ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 --noclear --autologin root --login-pause --host {{ vm_host }} %I $TERM