Skip to content

Commit

Permalink
remove fqcn for 2.9 compatibility (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
florianutz authored Mar 25, 2022
1 parent 7948f99 commit 65ad8e7
Show file tree
Hide file tree
Showing 11 changed files with 351 additions and 351 deletions.
26 changes: 13 additions & 13 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

- name: systemd restart tmp.mount
become: true
ansible.builtin.systemd:
systemd:
name: tmp.mount
daemon_reload: true
enabled: true
Expand All @@ -30,7 +30,7 @@

- name: systemd restart var-tmp.mount
become: true
ansible.builtin.systemd:
systemd:
name: var-tmp.mount
daemon_reload: true
enabled: true
Expand All @@ -40,12 +40,12 @@

- name: generate new grub config
become: true
ansible.builtin.command: grub-mkconfig -o "{{ grub_cfg.stat.path }}"
command: grub-mkconfig -o "{{ grub_cfg.stat.path }}"
notify: fix permissions after generate new grub config handler

- name: fix permissions after generate new grub config handler
become: true
ansible.builtin.file:
file:
path: "/boot/grub/grub.cfg"
owner: root
group: root
Expand All @@ -56,35 +56,35 @@

- name: restart firewalld
become: true
ansible.builtin.service:
service:
name: firewalld
state: restarted

- name: reload nftables
become: true
ansible.builtin.service:
service:
name: nftables
state: reloaded

- name: restart xinetd
become: true
ansible.builtin.service:
service:
name: xinetd
state: restarted

- name: restart sshd
become: true
ansible.builtin.service:
service:
name: sshd
state: restarted

- name: reload dconf
become: true
ansible.builtin.command: dconf update
command: dconf update

- name: restart auditd
become: true
ansible.builtin.service:
service:
name: auditd
state: restarted
when:
Expand All @@ -94,22 +94,22 @@

- name: load audit rules
become: true
ansible.builtin.command: /sbin/augenrules --load
command: /sbin/augenrules --load
when:
- not ubuntu2004cis_skip_for_travis
tags:
- skip_ansible_lint

- name: restart systemd-coredump
become: true
ansible.builtin.service:
service:
name: systemd-coredump.socket
daemon_reload: true
enabled: true
state: restarted

- name: restart journald
become: true
ansible.builtin.service:
service:
name: systemd-journald
state: restarted
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ galaxy_info:
description: "Ansible role to apply Ubuntu 20.04 CIS Baseline"
company: "none"
license: MIT
min_ansible_version: 2.10
min_ansible_version: 2.9
role_name: ubuntu2004_cis
namespace: florianutz

Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# tasks file for Ubuntu2004-CIS
- name: Check OS version and family
ansible.builtin.fail:
fail:
msg: "This role can only be run agaist Ubuntu 20.04. {{ ansible_distribution }} {{ ansible_distribution_major_version }} is not supported."
when:
- not ansible_distribution == "Ubuntu"
Expand All @@ -10,7 +10,7 @@
- always

- name: Check ansible version
ansible.builtin.fail:
fail:
msg: You must use ansible 2.3 or greater!
when: not ansible_version.full is version_compare('2.3', '>=')
tags:
Expand Down
4 changes: 2 additions & 2 deletions tasks/post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# Post tasks

- name: "POST | Find removed but configured apt packages"
ansible.builtin.shell: "set -o pipefail;
shell: "set -o pipefail;
dpkg --list | (grep ^rc || true) | tr -s ' ' | cut -d ' ' -f 2"
args:
executable: /bin/bash
register: apt_rc_packages
changed_when: false

- name: "POST | Perform apt package cleanup"
ansible.builtin.apt:
apt:
name: "{{ apt_rc_packages.stdout_lines }}"
state: absent
purge: true
Expand Down
Loading

0 comments on commit 65ad8e7

Please sign in to comment.