Browse Source

Merge "Add parameters for dateext in logrotate" into stable/stein

tags/10.6.1
Zuul 2 weeks ago
parent
commit
c778abdb78
1 changed files with 33 additions and 6 deletions
  1. 33
    6
      deployment/logrotate/logrotate-crond-container-puppet.yaml

+ 33
- 6
deployment/logrotate/logrotate-crond-container-puppet.yaml View File

@@ -54,6 +54,28 @@ parameters:
54 54
     description: Enforces life time (days) of rotated and compressed files.
55 55
     type: string
56 56
     default: '14'
57
+  LogrotateDateExt:
58
+    description: Enable/disable dateext parameter.
59
+    type: boolean
60
+    default: false
61
+  LogrotateDateFormat:
62
+    description: Configures dateformat strings for containerized logrotate.
63
+                 This is valid when LogrotateDateExt is true.
64
+                 The allowed specifiers are only %Y %m %d %H %M %S %V and %s.
65
+    type: string
66
+    default: '-%Y%m%d'
67
+    constraints:
68
+      - allowed_pattern: '-(%[YmdHMSVs])+$'
69
+  LogrotateDateYesterday:
70
+    description: Configures dateyesterday paramter for containerized logrotate.
71
+                 This is valid when LogrotateDateExt is true.
72
+    type: boolean
73
+    default: false
74
+
75
+conditions:
76
+
77
+  logrotatedateext_is_enabled: {equals: [{get_param: LogrotateDateExt}, true]}
78
+
57 79
 
58 80
 resources:
59 81
 
@@ -65,18 +87,23 @@ outputs:
65 87
     value:
66 88
       service_name: logrotate_crond
67 89
       config_settings:
68
-        tripleo::profile::base::logging::logrotate::maxsize: {get_param: LogrotateMaxsize}
69
-        tripleo::profile::base::logging::logrotate::rotation: {get_param: LogrotateRotationInterval}
70
-        tripleo::profile::base::logging::logrotate::rotate: {get_param: LogrotateRotate}
71
-        tripleo::profile::base::logging::logrotate::purge_after_days: {get_param: LogrotatePurgeAfterDays}
72
-
90
+        map_merge:
91
+          - tripleo::profile::base::logging::logrotate::maxsize: {get_param: LogrotateMaxsize}
92
+            tripleo::profile::base::logging::logrotate::rotation: {get_param: LogrotateRotationInterval}
93
+            tripleo::profile::base::logging::logrotate::rotate: {get_param: LogrotateRotate}
94
+            tripleo::profile::base::logging::logrotate::purge_after_days: {get_param: LogrotatePurgeAfterDays}
95
+            tripleo::profile::base::logging::logrotate::dateext: {get_param: LogrotateDateExt}
96
+          - if:
97
+            - logrotatedateext_is_enabled
98
+            - tripleo::profile::base::logging::logrotate::dateformat: {get_param: LogrotateDateFormat}
99
+              tripleo::profile::base::logging::logrotate::dateyesterday: {get_param: LogrotateDateYesterday}
100
+            - {}
73 101
       host_prep_tasks:
74 102
         - name: allow logrotate to read inside containers
75 103
           seboolean:
76 104
             name: logrotate_read_inside_containers
77 105
             persistent: yes
78 106
             state: yes
79
-
80 107
       deploy_steps_tasks:
81 108
         - name: configure tmpwatch on the host
82 109
           when: step|int == 2

Loading…
Cancel
Save