X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;ds=sidebyside;f=ansible%2Froles%2Fvm%2Fguest%2Ftasks%2Fmain.yml;h=e3ffd10779fd830b2a4550e367b6e2e6c14ab182;hb=7d815ed7383e6c18c2f5b439480c3bb389af99c0;hp=23f4ef45816145cc8507454557ce0eb3e88f03d5;hpb=56a484f6c3119b06da3f7065ec3dcbd2009a8d3b;p=noc.git diff --git a/ansible/roles/vm/guest/tasks/main.yml b/ansible/roles/vm/guest/tasks/main.yml index 23f4ef4..e3ffd10 100644 --- a/ansible/roles/vm/guest/tasks/main.yml +++ b/ansible/roles/vm/guest/tasks/main.yml @@ -2,15 +2,37 @@ apt: name: rng-tools state: present + force_apt_get: yes -- name: Configure rngd +- name: Configure rngd [1/2] lineinfile: path: /etc/default/rng-tools line: '{{ item.key }}={{ item.value }}' - regexp: '^#?{{ item.key }}={{ item.value }}' - with_dict: - HRNGDEVICE: /dev/hwrng - RNGDOPTIONS: '"-s 256 -W 80%"' + 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