Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm/guest: Drop obsoleted entropy-related daemons #68

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ansible/host_vars/vex/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ sshd_allowusers_host:
- www
- www-data
- acme

vm_guest_force_haveged: yes
7 changes: 6 additions & 1 deletion ansible/roles/base/tasks/02debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
- tcpdump
- debian-goodies
- lsof
- haveged
- net-tools
- screen
- aptitude
Expand All @@ -30,6 +29,12 @@
- lshw
state: present

- name: Install haveged on physical machines
when: "'virtualservers' not in group_names"
apt:
name: haveged
state: present

- name: make sure grml-(etc|scripts)-core is not installed
apt:
name:
Expand Down
36 changes: 14 additions & 22 deletions ansible/roles/vm/guest/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
- name: Install rngd
- name: Install and configure rngd (on kernel < 3.17)
when: ansible_kernel is version('3.17', '<')
import_tasks: rngd.yml

- name: Uninstall rngd (on kernel >= 3.17)
when: ansible_kernel is version('3.17', '>=')
apt:
name: rng-tools
state: present
force_apt_get: yes

- 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
state: absent
purge: yes

- name: Configure rngd [2/2]
lineinfile:
path: /etc/default/rng-tools
regexp: '^{{ item.key }}=(?!{{ item.value }})'
- name: Uninstall haveged
when: not (vm_guest_force_haveged | default(False))
apt:
name: haveged
state: absent
with_dict: '{{ rngd_config }}'
loop_control:
label: "{{ item.key }}"
notify: restart rngd
purge: yes

- name: Provide a root shell on the VM console [1/2]
file:
Expand All @@ -35,4 +27,4 @@
content: |
[Service]
ExecStart=
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 --noclear --autologin root --login-pause --host {{ vm_host }} %I $TERM
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 --noclear --autologin root --login-pause --host {{ vm_install_host }} %I $TERM
25 changes: 25 additions & 0 deletions ansible/roles/vm/guest/tasks/rngd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
- name: Install rngd
apt:
name: rng-tools
state: present
force_apt_get: yes

- 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