Skip to content

Commit

Permalink
Fixed review foundings
Browse files Browse the repository at this point in the history
Signed-off-by: Radovan Sroka <rsroka@redhat.com>
  • Loading branch information
radosroka committed Oct 26, 2023
1 parent 1ee6d33 commit 953d1b0
Show file tree
Hide file tree
Showing 21 changed files with 20 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ exclude_paths:
- .github/
- examples/roles/
mock_roles:
- linux-system-roles.template
- linux-system-roles.fapolicyd
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://help.github.com/en/articles/about-code-owners
# Default reviewers for everything
* @spetrosi @nhosoi @richm
* @spetrosi @richm
1 change: 0 additions & 1 deletion examples/inventory

This file was deleted.

4 changes: 2 additions & 2 deletions examples/simple.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: MIT
---
- name: Example template role invocation
- name: Example fapolicyd role invocation
hosts: all
vars:
fapolicyd_setup_enable_service: true
Expand All @@ -11,4 +11,4 @@
- /etc/fapolicyd/fapolicyd.conf
- /etc/krb5.conf
roles:
- fapolicyd
- linux-system-roles.fapolicyd
4 changes: 2 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: MIT
---
- name: Handler for template to restart services
- name: Handler for fapolicyd to restart services
service:
name: "{{ item }}"
state: restarted
loop: "{{ __template_services }}"
loop: "{{ __fapolicyd_services }}"
10 changes: 5 additions & 5 deletions tasks/enable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
msg: Fapolicyd does not support trust setting fapolicyd_setup_trust
ignore_errors: true
when:
- fapolicyd_setup_trust
- fapolicyd_setup_trust | lenght > 0
- ansible_facts.distribution_version is version("8.2", "<=")
register: __failed_check_trust

Expand All @@ -13,7 +13,7 @@
msg: Fapolicyd does not support integrity setting fapolicyd_setup_integrity
ignore_errors: true
when:
- fapolicyd_setup_integrity
- fapolicyd_setup_integrity | length > 0
- ansible_facts.distribution_version is version("8.3", "<=")
register: __failed_check_integrity

Expand All @@ -22,16 +22,16 @@
msg: Fapolicyd does not support trust files setting fapolicyd_add_trusted_file
ignore_errors: true
when:
- fapolicyd_add_trusted_file
- fapolicyd_add_trusted_file | length > 0
- ansible_facts.distribution_version is version("8.3", "<=")
register: __failed_check_trusted_file

- name: Check failed conditions
fail:
msg: Multiple failed conditions
#failed_when: true
when: __failed_check_trust is failed or __failed_check_integrity is failed or __failed_check_trusted_file is failed

when: __failed_check_trust is failed or __failed_check_integrity is failed or
__failed_check_trusted_file is failed

- name: Install fapolicyd packages
package:
Expand Down
2 changes: 2 additions & 0 deletions templates/fapolicyd.conf.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{ ansible_managed | comment }}
{{ "system_role:fapolicyd" | comment(prefix="", postfix="") }}
#
# This file controls the configuration of the file access policy daemon.
# See the fapolicyd.conf man page for explanation.
Expand Down
4 changes: 2 additions & 2 deletions tests/setup-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
tasks:
- name: Set platform/version specific variables
include_role:
name: linux-system-roles.template
name: linux-system-roles.fapolicyd
tasks_from: set_vars.yml
public: true

- name: Install test packages
package:
name: "{{ __template_packages }}"
name: "{{ __fapolicyd_packages }}"
state: present
4 changes: 2 additions & 2 deletions tests/tests_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
hosts: all
gather_facts: false # test that role works in this case
roles:
- linux-system-roles.template
- linux-system-roles.fapolicyd
tasks:
- name: Check header for ansible_managed, fingerprint
include_tasks: tasks/check_header.yml
vars:
__file: /etc/foo.conf
__file: "{{ __fapolicyd_dir }}/{{ __fapolicyd_conf }}"
__fingerprint: system_role:template
7 changes: 0 additions & 7 deletions vars/CentOS_8.yml

This file was deleted.

7 changes: 0 additions & 7 deletions vars/CentOS_9.yml

This file was deleted.

7 changes: 0 additions & 7 deletions vars/Fedora.yml

This file was deleted.

7 changes: 0 additions & 7 deletions vars/RedHat_8.yml

This file was deleted.

7 changes: 0 additions & 7 deletions vars/RedHat_9.yml

This file was deleted.

3 changes: 3 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ __fapolicyd_services: fapolicyd.service
__fapolicyd_dir: /etc/fapolicyd
__fapolicyd_conf: fapolicyd.conf

__fapolicyd_packages: [fapolicyd]
__fapolicyd_selinux_packages: [fapolicyd-selinux]

# ansible_facts required by the role
__template_required_facts:
- distribution
Expand Down

0 comments on commit 953d1b0

Please sign in to comment.