Skip to content
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: Added postfix_files feature as a simple means to add extra files/maps to config #129

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

Thulium-Drake
Copy link
Contributor

Enhancement: Added a means to configure extra files for Postfix

Reason: Some config options require to pick up additional information from a file (e.g. with SASL credentials etc). This PR adds 'postfix_files', a simple means of creating these files and integrating them in the Postfix configuration.

Result:

Issue Tracker Tickets (Jira or BZ if any):

@Thulium-Drake Thulium-Drake changed the title Added postfix_files feature as a simple means to add extra files/maps… feat: Added postfix_files feature as a simple means to add extra files/maps to config Jun 10, 2024
Copy link
Contributor

@spetrosi spetrosi left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, please add an entry to README.md about postfix_files and a test.

tasks/main.yml Outdated Show resolved Hide resolved
loop: "{{ postfix_files }}"
loop_control:
loop_var: file
changed_when: false
Copy link
Contributor

Choose a reason for hiding this comment

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

This task results in a change, is it? Is there a way to make it idempotent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly, no, there's no output for postmap and the exit code is always 0 (when it succeeds)

root@debian:~# touch file
root@debian:~# postmap file # creating a new file.db file
root@debian:~# echo $?
0
root@debian:~# postmap file # updates the existing file.db file
root@debian:~# echo $?
0

Copy link
Contributor

Choose a reason for hiding this comment

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

Can it list created files?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should not do this in a handler - see below

tasks/main.yml Show resolved Hide resolved
tasks/main.yml Outdated Show resolved Hide resolved
@richm
Copy link
Contributor

richm commented Jun 27, 2024

please rebase on the latest main branch to pick up the fix for the ansible lint github action

@richm
Copy link
Contributor

richm commented Jun 27, 2024

[citest]

1 similar comment
@Thulium-Drake
Copy link
Contributor Author

[citest]

@Thulium-Drake
Copy link
Contributor Author

Rebase done! :)

@richm
Copy link
Contributor

richm commented Jul 1, 2024

[citest]

@richm
Copy link
Contributor

richm commented Jul 1, 2024

@Thulium-Drake https://github.com/Thulium-Drake/ansible-role-postfix/pull/1 to fix test failures and rebase to latest main branch

@Thulium-Drake Thulium-Drake force-pushed the postfix_files_feature branch 4 times, most recently from 53b0c22 to 54b326a Compare July 2, 2024 10:10
@Thulium-Drake
Copy link
Contributor Author

This should do it then :-)

@richm
Copy link
Contributor

richm commented Jul 2, 2024

This should do it then :-)

Unfortunately, the PR cannot be merged - This branch cannot be rebased due to conflicts

I tried to fix this locally and push to your branch to update the PR:

To github.com:Thulium-Drake/ansible-role-postfix.git
 ! [remote rejected] Thulium-Drake-postfix_files_feature -> Thulium-Drake-postfix_files_feature (permission denied)
error: failed to push some refs to 'github.com:Thulium-Drake/ansible-role-postfix.git'

I think you have to explicitly give permission for role maintainers to do this - see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork

If you don't want to do this, then you'll need to rebase and squash - try this:

git checkout main
git pull
git checkout postfix_files_feature
git rebase main  # fix any rebase conflicts
git rebase -i main  # pick the first commit, then use `f` (fixup) for the rest of the commits.

@Thulium-Drake Thulium-Drake force-pushed the postfix_files_feature branch from 46d8dcd to d96af19 Compare July 9, 2024 20:44
@Thulium-Drake Thulium-Drake force-pushed the postfix_files_feature branch from d96af19 to c7ba240 Compare July 9, 2024 20:45
@Thulium-Drake
Copy link
Contributor Author

I tried the access route, but it didn't pan out. Thanks for the instructions on how to rebase (I don't do that too often 😅 )!

Should be good now (?)

🚀

@richm
Copy link
Contributor

richm commented Jul 9, 2024

[citest]

@richm richm merged commit 73b7c72 into linux-system-roles:main Jul 9, 2024
15 of 17 checks passed
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.

3 participants