Skip to content
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
6 changes: 6 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@
ansible.builtin.systemd:
name: systemd-journald
state: restarted

- name: Reload systemd
ansible.builtin.systemd:
daemon_reload: yes
become: true

2 changes: 2 additions & 0 deletions tasks/amazon_linux.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
- name: Amazon Linux 2 | Configure secure boot setting
include_tasks: configure_secure_boot_al2.yaml
- name: Amazon Linux 2 | Configure Time Synchronization
include_tasks: configure_time_synchronization_al2.yaml
- name: Amazon Linux 2 | Configure Filesystem Partitions
Expand Down
10 changes: 10 additions & 0 deletions tasks/configure_secure_boot_al2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: "Ensure authentication required for single user mode (rescue & emergency)"
ansible.builtin.lineinfile:
path: "/usr/lib/systemd/system/{{ item }}"
regexp: '^ExecStart='
line: 'ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"'
backup: yes
loop: "{{ rescue_emergency_units }}"
notify: Reload systemd

4 changes: 4 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ os_services_name: ['avahi-daemon', 'slapd', 'named', 'cups', 'telnet', 'discard-
minute_aide_cronjob: '0'
hour_aide_cronjob: '5'

#Configure SELinux
rescue_emergency_units:
- rescue.service
- emergency.service
# Configure Time Synchronization
chrony_amazon_timesync_block: |
# Amazon Linux 2 default Chrony configuration
Expand Down