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

unixPB: Install rng-tools to fix low entropy #3145

Merged
merged 1 commit into from
Sep 28, 2023
Merged
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
1 change: 1 addition & 0 deletions ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,4 @@
- role: logs
position: "End"
tags: always
- rngd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Install the rng-tools package (Fedora)
package:
name: rng-tools
state: latest

- name: Update the rngd.service file (Fedora)
ini_file:
path: /usr/lib/systemd/system/rngd.service
section: service
option: ExecStart
value: "/sbin/rngd -f -r /dev/urandom -o /dev/random"
backup: yes

- name: Start and enable "rngd" service (Fedora)
service:
name: rngd
state: started
enabled: yes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
################
# rng daemon #
################
- name: Install rng-tools and start service
tags: rngd
block:
- name: Install rng-tools and start rng-tools.service (Ubuntu)
include_tasks: ubuntu.yml
when:
- ansible_distribution == "Ubuntu" and ansible_distribution_major_version < "21"

- name: Install rng-tools and start rngd (Fedora)
include_tasks: fedora.yml
when:
- (ansible_distribution == "RedHat" and ansible_distribution_major_version <= "8") or
(ansible_distribution == "CentOS" and ansible_distribution_major_version <= "8")

- name: Install rng-tools and start rng-tools.service (SLES)
include_tasks: sles.yml
when:
- ansible_distribution == "SLES" and ansible_distribution_major_version <= "12"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Install the rng-tools package (SLES)
package:
name: rng-tools
state: latest

- name: Update the rng-tools.service file (SLES)
ini_file:
path: /usr/lib/systemd/system/rng-tools.service
section: service
option: ExecStart
value: "usr/sbin/rngd -f -r /dev/urandom -o /dev/random"
backup: yes

- name: Start and enable "rng-tools" service (SLES)
service:
name: rng-tools
state: started
enabled: yes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Install the rng-tools package (Ubuntu)
package:
name: rng-tools
state: latest

- name: Update the rng-tools defaults file (Ubuntu)
lineinfile:
dest: '/etc/default/rng-tools'
regexp: '^HRNGDEVICE=/dev/urandom'
mode: '0644'
insertafter: '^#HRNGDEVICE=/dev/null'
line: 'HRNGDEVICE=/dev/urandom'

- name: Start and enable "rngd" service (Ubuntu)
systemd:
name: rng-tools.service
state: started
enabled: yes
Loading