4830d05117a97c11a0b13ba71339529da816ff31
[noc.git] / ansible / roles / vm / guest / tasks / main.yml
1 - name: Install rngd
2   apt:
3     name: rng-tools
4     state: present
5
6 - name: Configure rngd [1/2]
7   lineinfile:
8     path: /etc/default/rng-tools
9     line: '{{ item.key }}={{ item.value }}'
10     regexp: '^#?{{ item.key }}='
11   with_dict: '{{ rngd_config }}'
12   loop_control:
13     label: "{{ item.key }}"
14   notify: restart rngd
15
16 - name: Configure rngd [2/2]
17   lineinfile:
18     path: /etc/default/rng-tools
19     regexp: '^{{ item.key }}=(?!{{ item.value }})'
20     state: absent
21   with_dict: '{{ rngd_config }}'
22   loop_control:
23     label: "{{ item.key }}"
24   notify: restart rngd
25
26 - name: Provide a root shell on the VM console [1/2]
27   file:
28     path: /etc/systemd/system/serial-getty@ttyS0.service.d/
29     state: directory
30
31 - name: Provide a root shell on the VM console [2/2]
32   copy:
33     dest: /etc/systemd/system/serial-getty@ttyS0.service.d/autologon.conf
34     content: |
35       [Service]
36       ExecStart=
37       ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 --noclear --autologin root --login-pause --host {{ vm_host }} %I $TERM