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

Add support for prerotate script (#22) #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danrough
Copy link


name: Add prerotate
about: logrotate allows for a user to specify a script that can be run before the rotate process runs. This change adds that functionality to this role.


Describe the change
I've copied the postrotate feature, and its tests, and duplicated it as prerotate.

Testing
Unfortunately, despite my efforts, I haven't been able to get molecule running with docker locally, and so I haven't been able to run the tests. It seems that docker-py 2.32.0 / requests has a an issue with ansible 9.6. I've tried upgrading to ansible 10.0.0b1, but I still haven't been able to get it to work.

@danrough
Copy link
Author

Just wanted to update to say that I have continued trying to get molecule working with the docker driver, and that I am still stuck. I posted a request for help regarding my problems with molecule on the ansible forum, you'll find it here: https://forum.ansible.com/t/critical-driver-docker-from-state-file-users-myusername-cache-molecule-ansible-role-logrotate-default-state-yml-is-not-available/5979

@robertdebock
Copy link
Owner

Looks good, let's wait for CI.

I'll change converge.yml after merging to include a generic example and a pre-rotate example. (Since that's being tested as well.)

@danrough
Copy link
Author

I wonder if the failures in these tests related to this bug, ansible-community/molecule-plugins#256

@danrough
Copy link
Author

@robertdebock I've just linked an issue that was found yesterday in molecule-plugins - I'm wondering if that might be the cause of these test failures. Sadly, despite my best efforts, I still can't get molecule working on my machine. Proof, if you need it that I am still trying is here on Reddit, and here on the ansible forum.

@danrough danrough force-pushed the feat/add-prerotate branch from fba8e2e to a80d870 Compare May 26, 2024 14:51
@danrough
Copy link
Author

I've pushed a fix for the duplicate files issue.

@danrough danrough force-pushed the feat/add-prerotate branch from a80d870 to 347fd32 Compare May 26, 2024 15:11
@danrough
Copy link
Author

molecule verify
WARNING  Driver docker does not provide a schema.
INFO     default scenario test matrix: verify
INFO     Performing prerun with role_name_check=0...
INFO     Running default > verify
INFO     Running Ansible Verifier
INFO     Sanity checks: 'docker'

PLAY [Verify] ******************************************************************

TASK [Run logrotate] ***********************************************************
changed: [logrotate-fedora-latest]

PLAY RECAP *********************************************************************
logrotate-fedora-latest    : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

INFO     Verifier completed successfully.

@mordekasg
Copy link

mordekasg commented Oct 16, 2024

@robertdebock
Is it possible to merge this PR?

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