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