This is an automated email from the ASF dual-hosted git repository.

srijeet0406 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new a29ef8e3b3 Update traffic_router.logrotate as well as Ansible block to 
copy file.  (#7239)
a29ef8e3b3 is described below

commit a29ef8e3b3ca0662f953fb7566089eb33d8bcb0b
Author: Joe Villa <[email protected]>
AuthorDate: Wed Dec 7 12:19:48 2022 -0700

    Update traffic_router.logrotate as well as Ansible block to copy file.  
(#7239)
    
    * Update traffic_router.logrotate
    
    * Update traffic_router.yml
    
    * Update traffic_router
    
    * Update build_rpm.sh
    
    Fixing build_rpm.sh by adding a mkdir for the logrotate.d directory.
    
    * Update pom.xml
    
    * Added vars to codeql.java.yaml and tr.test.yaml
    
    * Missing .
    
    Co-authored-by: Villa, Joseph <[email protected]>
---
 .github/workflows/codeql.java.yml                      |  2 ++
 .github/workflows/tr.tests.yaml                        |  2 ++
 .../traffic-router/files/traffic_router.logrotate      | 18 ++++++++++++++++++
 .../roles/traffic-router/tasks/traffic_router.yml      |  2 +-
 traffic_router/build/pom.xml                           |  2 ++
 .../core/src/main/lib/logrotate/traffic_router         | 17 +++++++++++++++++
 6 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/codeql.java.yml 
b/.github/workflows/codeql.java.yml
index 831616d056..514f83227c 100644
--- a/.github/workflows/codeql.java.yml
+++ b/.github/workflows/codeql.java.yml
@@ -37,6 +37,8 @@ jobs:
       RHEL_VERSION: rhel_version
       STARTUP_SCRIPT_DIR: /startup-dir
       STARTUP_SCRIPT_LOC: ../core/src/main/lib/systemd/system
+      LOGROTATE_SCRIPT_DIR: /etc/logrotate.d
+      LOGROTATE_SCRIPT_LOC: ../core/src/main/lib/logrotate
       TOMCAT_RELEASE: tomcat_release
       TOMCAT_VERSION: tomcat_version
 
diff --git a/.github/workflows/tr.tests.yaml b/.github/workflows/tr.tests.yaml
index 050e740188..b04a7b6443 100644
--- a/.github/workflows/tr.tests.yaml
+++ b/.github/workflows/tr.tests.yaml
@@ -24,6 +24,8 @@ env:
   RHEL_VERSION: rhel_version
   STARTUP_SCRIPT_DIR: /startup-dir
   STARTUP_SCRIPT_LOC: ../core/src/main/lib/systemd/system
+  LOGROTATE_SCRIPT_DIR: /etc/logrotate.d
+  LOGROTATE_SCRIPT_LOC: ../core/src/main/lib/logrotate
   TOMCAT_RELEASE: tomcat_release
   TOMCAT_VERSION: tomcat_version
 
diff --git 
a/infrastructure/ansible/roles/traffic-router/files/traffic_router.logrotate 
b/infrastructure/ansible/roles/traffic-router/files/traffic_router.logrotate
index cf6f862bd8..d0493ee6a1 100644
--- a/infrastructure/ansible/roles/traffic-router/files/traffic_router.logrotate
+++ b/infrastructure/ansible/roles/traffic-router/files/traffic_router.logrotate
@@ -1,3 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
 /opt/traffic_router/var/log/access.log {
     daily
     size 100m
diff --git 
a/infrastructure/ansible/roles/traffic-router/tasks/traffic_router.yml 
b/infrastructure/ansible/roles/traffic-router/tasks/traffic_router.yml
index e8f6490226..303bb51cd5 100644
--- a/infrastructure/ansible/roles/traffic-router/tasks/traffic_router.yml
+++ b/infrastructure/ansible/roles/traffic-router/tasks/traffic_router.yml
@@ -95,7 +95,7 @@
   register: tr_systemd
 
 - name: Copy traffic router logrotate file
-  file:
+  copy:
     src: traffic_router.logrotate
     dest: /etc/logrotate.d/traffic_router
     mode: 0644
diff --git a/traffic_router/build/pom.xml b/traffic_router/build/pom.xml
index 5ee9f7dc38..fef6d23d99 100644
--- a/traffic_router/build/pom.xml
+++ b/traffic_router/build/pom.xml
@@ -94,6 +94,8 @@
                                                                        
<variableName>RPM_TARGET_OS</variableName>
                                                                        
<variableName>STARTUP_SCRIPT_DIR</variableName>
                                                                        
<variableName>STARTUP_SCRIPT_LOC</variableName>
+                                                                       
<variableName>LOGROTATE_SCRIPT_DIR</variableName>
+                                                                       
<variableName>LOGROTATE_SCRIPT_LOC</variableName>
                                                                
</requireEnvironmentVariable>
                                                        </rules>
                                                        <fail>true</fail>
diff --git a/traffic_router/core/src/main/lib/logrotate/traffic_router 
b/traffic_router/core/src/main/lib/logrotate/traffic_router
index 2604d09a8b..a8709c14a2 100644
--- a/traffic_router/core/src/main/lib/logrotate/traffic_router
+++ b/traffic_router/core/src/main/lib/logrotate/traffic_router
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 /opt/traffic_router/var/log/access.log {
     daily
     size 1k

Reply via email to