#2478 fix logrotate to match file with date
Merged a month ago by kevin. Opened 4 months ago by seddik.
fedora-infra/ seddik/ansible logrotate_fix  into  main

files/httpd/httpd.logrotate.j2 files/httpd/httpd.logrotate
file renamed
+5 -1
@@ -1,4 +1,8 @@ 

- /var/log/httpd/*log {

+ /var/log/httpd/*log 

+ {% if ansible_hostname.startswith("kojipkgs") %}

+ /var/log/httpd/*.log.????-??-??

+ {% endif %}

+ {

      daily

      rotate 7

      missingok

file modified
+1 -1
@@ -83,7 +83,7 @@ 

    - apachestatus

  

  - name: Setup logrotate to our needs

-   ansible.builtin.copy: src="{{ files }}/httpd/httpd.logrotate" dest=/etc/logrotate.d/httpd

+   ansible.builtin.template: src="{{ files }}/httpd/httpd.logrotate.j2" dest=/etc/logrotate.d/httpd

    tags:

    - config

    - apache

This will take care of the YYYY-MM-DD ones... but there is still also a access_log one.

So perhaps 2 entries? or some regex that works for both?

rebased onto 6d4c6b0

4 months ago

well, you shouldn't need *log and access_log right? the first one should match...

I think there may not be newlines between the logs to match? not 100% sure tho.

rebased onto f103010

3 months ago

Metadata Update from @kevin:
- Pull-request tagged with: post-freeze

3 months ago

rebased onto 2f67aad

3 months ago

rebased onto 2f67aad

3 months ago

Sorry this one has lingered so long. ;(

So, this will only matter on those kojipkgs servers, but it will apply to everything. Will it cause problems for non matching hosts?

Or perhaps can we just do a specific one for kojipkgs instead of changing every one all over?

rebased onto 5561372

a month ago

@kevin I've just updated with condition !
Can you test this ??

That looks ok, but... this is a file, not a template. We would need to move it to a .j2 file and change the copy to a template in the ansible play(s) that call it.

Can you do that?

Sorry this is drawing out so long. Thanks for working on it!

rebased onto 8a9adc5

a month ago

That looks ok, but... this is a file, not a template. We would need to move it to a .j2 file and change the copy to a template in the ansible play(s) that call it.

Can you do that?

Sorry this is drawing out so long. Thanks for working on it!

yes I've just updated the PR , thank you

rebased onto e9734b9

a month ago

rebased onto e9734b9

a month ago

Pull-Request has been merged by kevin

a month ago