summaryrefslogtreecommitdiff
path: root/roles/vm/guest/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vm/guest/tasks')
-rw-r--r--roles/vm/guest/tasks/main.yml37
1 files changed, 37 insertions, 0 deletions
diff --git a/roles/vm/guest/tasks/main.yml b/roles/vm/guest/tasks/main.yml
new file mode 100644
index 00000000..4830d051
--- /dev/null
+++ b/roles/vm/guest/tasks/main.yml
@@ -0,0 +1,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