make the repo conform with ansible-lint

This commit is contained in:
Emmanuel Seyman 2026-09-14 23:23:40 +02:00 • committed by Rowan Puttergill
commit 5a81ce5e40
23 changed files with 42 additions and 81 deletions

1
.ansible-lint-ignore Normal file
View file

@ -0,0 +1 @@
roles/postinstall/tasks/14-update-system-software.yml package-latest skip

View file

@ -1,21 +0,0 @@
# SPDX-License-Identifier: GPL-3.0
---
# defaults file for fedora-server-postinstall
# what postinstall tasks do we want to run
disable-ssh-with-passwords: true
increase-cockpit-security: false
root-login-key: false
hostname-time-configuration: true
install-failban: true
install-logwatch: true
disable-LLMNR-mDNS: true
manage-system-updates: true
update-system-software: true
# dnf-automatic configuration
automatic_apply_updates: no
automatic_email_to: root
automatic_email_host: localhost
automatic_email_port: 25
automatic_email_tls: no

View file

@ -1,40 +0,0 @@
---
- name: Install and configure Apache
hosts: webservers
tasks:
- name: 10. Install fail2ban
ansible.builtin.package:
name: fail2ban
state: present
- name: 11. Install packages
ansible.builtin.package:
name: logwatch
state: present
- name: 12. Disable systemd-resolved LLMNR and/or mDNS
ansible.builtin.file:
name: files/resolved-20-disable-llmnr-mdns.conf
dest: /etc/systemd/resolved.conf.d/20-disable-llmnr-mdns.conf
- name: 13. Install dnf-automatic
ansible.builtin.package:
name: dnf-automatic
state: present
- name: Configure notifications
ansible.builtin.file:
name:
dest: /etc/dnf/automatic.conf
- name: 13. Start the notifyonly timer
ansible.builtin.service:
name: dnf-automatic-notifyonly
state: started
enabled: true
- name: 13. Start the install timer
ansible.builtin.service:
name: dnf-automatic-install
state: started
enabled: true

View file

@ -1,7 +1,7 @@
Post-install Role
=================
This role is designed to handle common and recommended post-install configuration tasks for newly deployed Fedora Server systems. It focuses on security hardening, system updates, and essential configuration for production environments.
This role is designed to handle common and recommended postinstall configuration tasks for newly deployed Fedora Server systems. It focuses on security hardening, system updates, and essential configuration for production environments.
Requirements
------------
@ -71,7 +71,7 @@ To use this role in your playbook, create a playbook file, for example `site.yml
- hostmin
- admin
roles:
- { role: "fedora-ansible.post-install" }
- { role: "fedora-ansible.postinstall" }
...
```

View file

@ -0,0 +1,21 @@
# SPDX-License-Identifier: GPL-3.0
---
# defaults file for fedora-server-postinstall
# what postinstall tasks do we want to run
postinstall_disable_ssh_with_passwords: true
postinstall_increase_cockpit_security: false
postinstall_root_login_key: false
postinstall_hostname_time_configuration: true
postinstall_install_failban: true
postinstall_install_logwatch: true
postinstall_disable_llmnr_mdns: true
postinstall_manage_system_updates: true
postinstall_update_system_software: true
# dnf-automatic configuration
postinstall_automatic_apply_updates: 'no'
postinstall_automatic_email_to: root
postinstall_automatic_email_host: localhost
postinstall_automatic_email_port: 25
postinstall_automatic_email_tls: 'no'

View file

@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-3.0
galaxy_info:
author: your name
description: your role description
company: your company (optional)
author: Fedora Server SIG
description: Postinstall tasks for a Fedora Server instance
# company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
@ -17,7 +17,7 @@ galaxy_info:
# - CC-BY-4.0
license: GPL-3.0
min_ansible_version: 2.2
min_ansible_version: '2.2'
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

View file

@ -10,7 +10,7 @@
- name: Create SSH local configuration file based on template
ansible.builtin.template:
src: sshd_60-local.conf.j2
src: sshd_60-local.conf.j2
dest: /etc/ssh/sshd_config.d/60-local.conf
mode: '0644'
@ -19,4 +19,3 @@
state: reloaded
name: sshd.service
enabled: true

View file

@ -6,7 +6,7 @@
name: dnf5-plugin-automatic
state: present
- name: Configure dnf-automatic with template and variables
- name: Configure dnf-automatic with template and variables
ansible.builtin.template:
src: dnf_automatic.conf.j2
dest: /etc/dnf/automatic.conf

View file

@ -6,46 +6,46 @@
- name: 3. Disable SSH Login with passwords for system users
ansible.builtin.import_tasks:
file: 03-disable-ssh-with-passwords.yml
when: disable-ssh-with-passwords
when: postinstall_disable_ssh_with_passwords
# linux-system-roles.firewall ???
- name: 4. Increase security of Cockpit access
ansible.builtin.import_tasks:
file: 04-increase-cockpit-security.yml
when: increase-cockpit-security
when: postinstall_increase_cockpit_security
- name: 5. Set up root login via key file
ansible.builtin.import_tasks:
file: 05-root-login-key.yml
when: root-login-key
when: postinstall_root_login_key
# linux-system-roles.timesync ???
- name: 6. Double check hostname and time synchronisation
ansible.builtin.import_tasks:
file: 06-hostname-time-configuration.yml
when: hostname-time-configuration
when: postinstall_hostname_time_configuration
- name: 10. Install fail2ban
ansible.builtin.import_tasks:
file: 10-install-failban.yml
when: install-failban
when: postinstall_install_failban
- name: 11. Install and configure Logwatch
ansible.builtin.import_tasks:
file: 11-install-logwatch.yml
when: install-logwatch
when: postinstall_install_logwatch
- name: 12. Disable systemd-resolved LLMNR and/or mDNS
ansible.builtin.import_tasks:
file: 12-disable-LLMNR-mDNS.yml
when: disable-LLMNR-mDNS
when: postinstall_disable_llmnr_mdns
- name: 13. Manage system updates
ansible.builtin.import_tasks:
file: 13-manage-system-updates.yml
when: manage-system-updates
when: postinstall_manage_system_updates
- name: 14. Update system and additional software
ansible.builtin.import_tasks:
file: 14-update-system-software.yml
when: update-system-software
when: postinstall_update_system_software

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-3.0
---
- hosts: localhost
- name: Test
hosts: localhost
remote_user: root
roles:
- fedora-server-postinstall
- postinstall