-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Make the role work on Debian based systems #130
feat: Make the role work on Debian based systems #130
Conversation
[citest] |
The CI errors don't seem related to this change?
|
@@ -111,6 +111,8 @@ | |||
cp /etc/postfix/main.cf | |||
/etc/postfix/main.cf.{{ postfix_backup_multiple | | |||
ternary("$(date -Iseconds)", "backup") }} | |||
args: | |||
executable: /bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? Does Debian use some other executable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Debian uses Dash when scripts are run with /bin/sh, and that does not support pipefail
as option:
# ls -al $(which sh)
lrwxrwxrwx 1 root root 4 Jan 5 2023 /usr/bin/sh -> dash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this task copies files, and we can use the copy
module instead of using shell
. There is an old #2 that nobody looked at for years, but it has some good code that would fix this. Can you use it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also - if we do want to keep the shell
- instead of using a different executable, this is how we solve the pipefail
issue with other system roles - https://github.com/linux-system-roles/timesync/blob/main/tests/tests_ntp_provider3.yml#L52-L55 e.g. check if pipefail
is a supported option, and set it if it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am about to merge #2, which will fix the issue with pipefail. This PR now lacks adding compatibility with Debian in meta/main.yml, like in https://github.com/linux-system-roles/ssh/blob/main/meta/main.yml#L18-L23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, that will also fix it :)
Shall I close this one then?
Will fix by #2 instead |
Enhancement: Make role work on Debian
Reason: I have a few systems that run Debian and I wanted to configure Postfix on them in the same manner as I do RHEL based systems.
Result: Role now works on Debian (note that SELinux and Firewalld are not supported/tested)
Issue Tracker Tickets (Jira or BZ if any):