Skip to content

Commit

Permalink
Merge pull request #1648 from sriramandev/topic/ssriraman/install-log…
Browse files Browse the repository at this point in the history
…rotate

Enable cleanup for /var/log/messages on Photon for vSphere Provider
  • Loading branch information
k8s-ci-robot authored Dec 10, 2024
2 parents ace9c5f + 8584d62 commit 5e7ed38
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions images/capi/ansible/roles/node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,19 @@ photon_3_rpms:
- python-netifaces
- python-requests
- jq
- logrotate

# Creating photon_4_rpms for adding future packages if needed.
# Since empty list errors out, jq is added.
photon_4_rpms:
- jq
- logrotate

# Creating photon_5_rpms for adding future packages if needed.
# Since empty list errors out, jq is added.
photon_5_rpms:
- jq
- logrotate

common_virt_rpms:
- open-vm-tools
Expand Down
1 change: 1 addition & 0 deletions images/capi/ansible/roles/providers/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
networkd_dispatcher_download_url: https://gitlab.com/craftyguy/networkd-dispatcher/-/archive/2.1/networkd-dispatcher-2.1.tar.gz
packer_builder_type: ""
build_target: virt
var_log_messages_maxsize: 100M
6 changes: 6 additions & 0 deletions images/capi/ansible/roles/providers/tasks/vmware-photon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@
owner: root
group: root
mode: a+x

- name: Create configuration for rotate /var/log/messages
ansible.builtin.template:
src: etc/logrotate.d/messages.j2
dest: /etc/logrotate.d/messages
mode: a+x
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/var/log/messages {
compress
nodateext
rotate 5
daily
maxsize {{ var_log_messages_maxsize }}
missingok
notifempty
copytruncate
}
9 changes: 9 additions & 0 deletions images/capi/packer/goss/goss-vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ photon_3_rpms: &photon_3_rpms
python-netifaces:
python-requests:
jq:
logrotate:

photon_4_rpms: &photon_4_rpms
jq:
logrotate:

photon_5_rpms: &photon_5_rpms
jq:
logrotate:

arch: "amd64"
containerd_version: ""
Expand Down Expand Up @@ -216,6 +219,12 @@ photon:
<<: *common_photon_rpms
audit:
ova:
files:
'/etc/logrotate.d/messages':
exists: true
filetype: file
contains:
- "maxsize"
command:
grep apparmor=0 /boot/photon.cfg:
exit-status: 0
Expand Down

0 comments on commit 5e7ed38

Please sign in to comment.