Skip to content

RHEL compatibility - #27

Open
rwahyudi wants to merge 3 commits into
FoxyRoles:masterfrom
rwahyudi:rhel
Open

RHEL compatibility #27
rwahyudi wants to merge 3 commits into
FoxyRoles:masterfrom
rwahyudi:rhel

Conversation

@rwahyudi

Copy link
Copy Markdown

Add RHEL compatibility

Comment thread defaults/main.yml Outdated
### Opendkim package configuration
# - Redhat : /etc/opendkim.conf
# - Debian / default configuration default to : /etc/default/opendkim
dkim_default_config_file: "{{ '/etc/opendkim.conf' if ansible_distribution_file_variety == 'RedHat' else '/etc/default/opendkim' }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that /etc/opendkim.conf is main config file, not defaults as they are in Debian/Ubuntu. It would be probably better idea make distro conditions to commands working with defaults file?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is ansible_distribution_file_variety proper var to test? Why you choosed this one?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback!
I'll make /etc/opendkim.conf as default.

After further testing, I think using ansible_os_family would be better suited.
ansible_distribution_file_variety would produce Centos/Alma/Rocky on Redhat derivatives.

Mapping for OS family : https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/system/distribution.py#L511

I don't have much exposure to Debian derivatives so can't comment on that.

Comment thread tasks/opendkim.yml
name: epel-release
state: latest
when:
- ansible_os_family == 'RedHat'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather have separate install files (install_debian.yml, install_redhat.yml) per platform and conditions during include in main.yml

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the only thing that differs is the epel installation. Would you rather have install_debian_postfix.yml, install_debian_sendmail.yml, install_debian_opendkim.yml and its redhat equivalent?

Comment thread README.md Outdated
Ansible role for configuring [Postfix](http://www.postfix.org/) with [OpenDKIM](http://opendkim.org/), an implementation for Linux of [DKIM mail signing](http://dkim.org/). Works on [Debian](https://debian.org) distributions and derived like [Ubuntu](https://ubuntu.com/).
Ansible role for configuring [Postfix](http://www.postfix.org/) with [OpenDKIM](http://opendkim.org/), an implementation for Linux of [DKIM mail signing](http://dkim.org/).
Works on [Debian](https://debian.org) distributions and derived like [Ubuntu](https://ubuntu.com/).
Also works on Redhat 9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use:

Works on

Any idea if your update will work on other RedHat releases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants