aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Dobrelya <bdobreli@redhat.com>2017-08-02 14:48:26 +0200
committerBogdan Dobrelya <bdobreli@redhat.com>2017-08-21 08:56:29 +0200
commit8a03456056b22a0abff470dfd81334e369ae4cbc (patch)
tree7d465a2119026cc4c80b137dbdbb3ae617833a5c
parent5feec1d76151a604833260edc202e67cf87251e6 (diff)
Add logrotate with crond service
Add a docker service template to provide containerized services logs rotation with a crond job. Add OS::TripleO::Services::LogrotateCrond to CI multinode-containers and to all environments among with generic services like Ntp or Kernel. Set it to OS::Heat::None for non containerized environments and only enable it to the environments/docker.yaml. Closes-bug: #1700912 Change-Id: Ic94373f0a0758e9959e1f896481780674437147d Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
-rw-r--r--ci/environments/multinode-containers.yaml1
-rw-r--r--docker/services/logrotate-crond.yaml84
-rw-r--r--environments/contrail/roles_data_contrail.yaml10
-rw-r--r--environments/docker.yaml1
-rw-r--r--environments/hyperconverged-ceph.yaml1
-rw-r--r--overcloud-resource-registry-puppet.j2.yaml1
-rw-r--r--roles/BlockStorage.yaml1
-rw-r--r--roles/CephStorage.yaml1
-rw-r--r--roles/Compute.yaml1
-rw-r--r--roles/ComputeHCI.yaml1
-rw-r--r--roles/ComputeOvsDpdk.yaml1
-rw-r--r--roles/Controller.yaml1
-rw-r--r--roles/ControllerOpenstack.yaml1
-rw-r--r--roles/Database.yaml1
-rw-r--r--roles/IronicConductor.yaml1
-rw-r--r--roles/Messaging.yaml1
-rw-r--r--roles/Networker.yaml1
-rw-r--r--roles/ObjectStorage.yaml1
-rw-r--r--roles/Telemetry.yaml1
-rw-r--r--roles/Undercloud.yaml1
-rw-r--r--roles_data.yaml5
-rw-r--r--roles_data_undercloud.yaml1
22 files changed, 118 insertions, 0 deletions
diff --git a/ci/environments/multinode-containers.yaml b/ci/environments/multinode-containers.yaml
index 651aaf4..03baf4a 100644
--- a/ci/environments/multinode-containers.yaml
+++ b/ci/environments/multinode-containers.yaml
@@ -52,6 +52,7 @@ parameter_defaults:
- OS::TripleO::Services::NovaMetadata
- OS::TripleO::Services::NovaScheduler
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::TripleoPackages
diff --git a/docker/services/logrotate-crond.yaml b/docker/services/logrotate-crond.yaml
new file mode 100644
index 0000000..f49fd36
--- /dev/null
+++ b/docker/services/logrotate-crond.yaml
@@ -0,0 +1,84 @@
+heat_template_version: pike
+
+description: >
+ Containerized logrotate with crond for containerized service logs rotation
+
+parameters:
+ DockerCrondImage:
+ description: image
+ type: string
+ DockerCrondConfigImage:
+ description: The container image to use for the crond config_volume
+ type: string
+ EndpointMap:
+ default: {}
+ description: Mapping of service endpoint -> protocol. Typically set
+ via parameter_defaults in the resource registry.
+ type: json
+ ServiceData:
+ default: {}
+ description: Dictionary packing service data
+ type: json
+ ServiceNetMap:
+ default: {}
+ description: Mapping of service_name -> network name. Typically set
+ via parameter_defaults in the resource registry. This
+ mapping overrides those in ServiceNetMapDefaults.
+ type: json
+ DefaultPasswords:
+ default: {}
+ type: json
+ RoleName:
+ default: ''
+ description: Role name on which the service is applied
+ type: string
+ RoleParameters:
+ default: {}
+ description: Parameters specific to the role
+ type: json
+
+
+resources:
+
+ ContainersCommon:
+ type: ./containers-common.yaml
+
+outputs:
+ role_data:
+ description: Role data for the crond role.
+ value:
+ service_name: logrotate_crond
+ config_settings: {}
+ step_config: &step_config |
+ include ::tripleo::profile::base::logging::logrotate
+ # BEGIN DOCKER SETTINGS
+ puppet_config:
+ config_volume: crond
+ step_config: *step_config
+ config_image: {get_param: DockerCrondConfigImage}
+ kolla_config:
+ /var/lib/kolla/config_files/logrotate-crond.json:
+ command: /usr/sbin/crond -s -n
+ config_files:
+ - source: "/var/lib/kolla/config_files/src/*"
+ dest: "/"
+ merge: true
+ preserve_properties: true
+ docker_config:
+ step_4:
+ logrotate_crond:
+ image: {get_param: DockerCrondImage}
+ net: none
+ pid: host
+ privileged: true
+ user: root
+ restart: always
+ volumes:
+ list_concat:
+ - {get_attr: [ContainersCommon, volumes]}
+ -
+ - /var/lib/kolla/config_files/logrotate-crond.json:/var/lib/kolla/config_files/config.json:ro
+ - /var/lib/config-data/puppet-generated/logrotate-crond/:/var/lib/kolla/config_files/src:ro
+ - /var/log/containers:/var/log/containers
+ environment:
+ - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
diff --git a/environments/contrail/roles_data_contrail.yaml b/environments/contrail/roles_data_contrail.yaml
index eae809a..dd1c545 100644
--- a/environments/contrail/roles_data_contrail.yaml
+++ b/environments/contrail/roles_data_contrail.yaml
@@ -66,6 +66,7 @@
- OS::TripleO::Services::NovaVncProxy
- OS::TripleO::Services::Ec2Api
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::SwiftProxy
- OS::TripleO::Services::SwiftStorage
- OS::TripleO::Services::SwiftRingBuilder
@@ -122,6 +123,7 @@
- OS::TripleO::Services::CephExternal
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::Sshd
- OS::TripleO::Services::NovaCompute
@@ -149,6 +151,7 @@
- OS::TripleO::Services::BlockStorageCinderVolume
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::Sshd
@@ -165,6 +168,7 @@
- OS::TripleO::Services::CertmongerUser
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::SwiftStorage
- OS::TripleO::Services::SwiftRingBuilder
- OS::TripleO::Services::Snmp
@@ -184,6 +188,7 @@
- OS::TripleO::Services::CephOSD
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::Sshd
- OS::TripleO::Services::Timezone
@@ -203,6 +208,7 @@
- OS::TripleO::Services::ContrailWebUI
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::TripleoPackages
@@ -217,6 +223,7 @@
- OS::TripleO::Services::ContrailAnalytics
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::TripleoPackages
@@ -230,6 +237,7 @@
- OS::TripleO::Services::ContrailAnalyticsDatabase
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::TripleoPackages
@@ -243,6 +251,7 @@
- OS::TripleO::Services::ContrailTsn
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::TripleoPackages
@@ -256,6 +265,7 @@
- OS::TripleO::Services::ContrailTsn
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::TripleoPackages
diff --git a/environments/docker.yaml b/environments/docker.yaml
index a47e0d4..dfa30b0 100644
--- a/environments/docker.yaml
+++ b/environments/docker.yaml
@@ -51,6 +51,7 @@ resource_registry:
OS::TripleO::Services::Horizon: ../docker/services/horizon.yaml
OS::TripleO::Services::Iscsid: ../docker/services/iscsid.yaml
OS::TripleO::Services::Multipathd: ../docker/services/multipathd.yaml
+ OS::TripleO::Services::ContainersLogrotateCrond: ../docker/services/logrotate-crond.yaml
# FIXME: Had to remove these to unblock containers CI. They should be put back when fixed.
# OS::TripleO::Services::CinderApi: ../docker/services/cinder-api.yaml
# OS::TripleO::Services::CinderScheduler: ../docker/services/cinder-scheduler.yaml
diff --git a/environments/hyperconverged-ceph.yaml b/environments/hyperconverged-ceph.yaml
index 834c4f1..8104417 100644
--- a/environments/hyperconverged-ceph.yaml
+++ b/environments/hyperconverged-ceph.yaml
@@ -11,6 +11,7 @@ parameter_defaults:
- OS::TripleO::Services::CephExternal
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::Sshd
- OS::TripleO::Services::Securetty
diff --git a/overcloud-resource-registry-puppet.j2.yaml b/overcloud-resource-registry-puppet.j2.yaml
index 7bcc6d8..0f0e9ce 100644
--- a/overcloud-resource-registry-puppet.j2.yaml
+++ b/overcloud-resource-registry-puppet.j2.yaml
@@ -195,6 +195,7 @@ resource_registry:
OS::TripleO::Services::NovaLibvirt: puppet/services/nova-libvirt.yaml
OS::TripleO::Services::NovaMigrationTarget: puppet/services/nova-migration-target.yaml
OS::TripleO::Services::Ntp: puppet/services/time/ntp.yaml
+ OS::TripleO::Services::ContainersLogrotateCrond: OS::Heat::None
OS::TripleO::Services::SwiftProxy: puppet/services/swift-proxy.yaml
OS::TripleO::Services::ExternalSwiftProxy: OS::Heat::None
OS::TripleO::Services::SwiftStorage: puppet/services/swift-storage.yaml
diff --git a/roles/BlockStorage.yaml b/roles/BlockStorage.yaml
index e4fdfa4..9d1bef0 100644
--- a/roles/BlockStorage.yaml
+++ b/roles/BlockStorage.yaml
@@ -21,6 +21,7 @@
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::MySQLClient
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::Snmp
diff --git a/roles/CephStorage.yaml b/roles/CephStorage.yaml
index f3978c5..8e62e8e 100644
--- a/roles/CephStorage.yaml
+++ b/roles/CephStorage.yaml
@@ -18,6 +18,7 @@
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::MySQLClient
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::Snmp
diff --git a/roles/Compute.yaml b/roles/Compute.yaml
index ce5ab74..9d2c818 100644
--- a/roles/Compute.yaml
+++ b/roles/Compute.yaml
@@ -44,6 +44,7 @@
- OS::TripleO::Services::NovaLibvirt
- OS::TripleO::Services::NovaMigrationTarget
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::OpenDaylightOvs
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
diff --git a/roles/ComputeHCI.yaml b/roles/ComputeHCI.yaml
index 0e8a90b..0216b04 100644
--- a/roles/ComputeHCI.yaml
+++ b/roles/ComputeHCI.yaml
@@ -35,6 +35,7 @@
- OS::TripleO::Services::NovaLibvirt
- OS::TripleO::Services::NovaMigrationTarget
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::OpenDaylightOvs
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
diff --git a/roles/ComputeOvsDpdk.yaml b/roles/ComputeOvsDpdk.yaml
index 7c3cd21..9b94710 100644
--- a/roles/ComputeOvsDpdk.yaml
+++ b/roles/ComputeOvsDpdk.yaml
@@ -31,6 +31,7 @@
- OS::TripleO::Services::NovaCompute
- OS::TripleO::Services::NovaLibvirt
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::OpenDaylightOvs
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
diff --git a/roles/Controller.yaml b/roles/Controller.yaml
index 3d9173c..93a58df 100644
--- a/roles/Controller.yaml
+++ b/roles/Controller.yaml
@@ -109,6 +109,7 @@
- OS::TripleO::Services::NovaScheduler
- OS::TripleO::Services::NovaVncProxy
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::OctaviaApi
- OS::TripleO::Services::OctaviaHealthManager
- OS::TripleO::Services::OctaviaHousekeeping
diff --git a/roles/ControllerOpenstack.yaml b/roles/ControllerOpenstack.yaml
index 30ca3d3..fdbec59 100644
--- a/roles/ControllerOpenstack.yaml
+++ b/roles/ControllerOpenstack.yaml
@@ -80,6 +80,7 @@
- OS::TripleO::Services::NovaScheduler
- OS::TripleO::Services::NovaVncProxy
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::OctaviaApi
- OS::TripleO::Services::OctaviaHealthManager
- OS::TripleO::Services::OctaviaHousekeeping
diff --git a/roles/Database.yaml b/roles/Database.yaml
index e1ee63b..ffeada0 100644
--- a/roles/Database.yaml
+++ b/roles/Database.yaml
@@ -17,6 +17,7 @@
- OS::TripleO::Services::MySQL
- OS::TripleO::Services::MySQLClient
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Pacemaker
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::Snmp
diff --git a/roles/IronicConductor.yaml b/roles/IronicConductor.yaml
index da75884..d5d8ddd 100644
--- a/roles/IronicConductor.yaml
+++ b/roles/IronicConductor.yaml
@@ -15,6 +15,7 @@
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::MySQLClient
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::Timezone
diff --git a/roles/Messaging.yaml b/roles/Messaging.yaml
index d165c6e..cd6071c 100644
--- a/roles/Messaging.yaml
+++ b/roles/Messaging.yaml
@@ -15,6 +15,7 @@
- OS::TripleO::Services::FluentdClient
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Pacemaker
- OS::TripleO::Services::RabbitMQ
- OS::TripleO::Services::SensuClient
diff --git a/roles/Networker.yaml b/roles/Networker.yaml
index a9bbffd..1bf5803 100644
--- a/roles/Networker.yaml
+++ b/roles/Networker.yaml
@@ -30,6 +30,7 @@
- OS::TripleO::Services::NeutronOvsAgent
- OS::TripleO::Services::NeutronVppAgent
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::OpenDaylightOvs
- OS::TripleO::Services::PacemakerRemote
- OS::TripleO::Services::SensuClient
diff --git a/roles/ObjectStorage.yaml b/roles/ObjectStorage.yaml
index ad372be..e2eacd9 100644
--- a/roles/ObjectStorage.yaml
+++ b/roles/ObjectStorage.yaml
@@ -26,6 +26,7 @@
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::MySQLClient
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::Snmp
diff --git a/roles/Telemetry.yaml b/roles/Telemetry.yaml
index 538a1bf..7bc93a4 100644
--- a/roles/Telemetry.yaml
+++ b/roles/Telemetry.yaml
@@ -25,6 +25,7 @@
- OS::TripleO::Services::MongoDb
- OS::TripleO::Services::MySQL
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::PankoApi
- OS::TripleO::Services::RabbitMQ
- OS::TripleO::Services::Redis
diff --git a/roles/Undercloud.yaml b/roles/Undercloud.yaml
index a408a21..a78ba39 100644
--- a/roles/Undercloud.yaml
+++ b/roles/Undercloud.yaml
@@ -39,6 +39,7 @@
- OS::TripleO::Services::NovaPlacement
- OS::TripleO::Services::NovaScheduler
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::RabbitMQ
- OS::TripleO::Services::SwiftProxy
- OS::TripleO::Services::SwiftRingBuilder
diff --git a/roles_data.yaml b/roles_data.yaml
index bde656f..7799fda 100644
--- a/roles_data.yaml
+++ b/roles_data.yaml
@@ -112,6 +112,7 @@
- OS::TripleO::Services::NovaScheduler
- OS::TripleO::Services::NovaVncProxy
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::OctaviaApi
- OS::TripleO::Services::OctaviaHealthManager
- OS::TripleO::Services::OctaviaHousekeeping
@@ -186,6 +187,7 @@
- OS::TripleO::Services::NovaLibvirt
- OS::TripleO::Services::NovaMigrationTarget
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::OpenDaylightOvs
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
@@ -220,6 +222,7 @@
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::MySQLClient
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::Snmp
@@ -256,6 +259,7 @@
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::MySQLClient
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::Snmp
@@ -286,6 +290,7 @@
- OS::TripleO::Services::Kernel
- OS::TripleO::Services::MySQLClient
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::Securetty
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::Snmp
diff --git a/roles_data_undercloud.yaml b/roles_data_undercloud.yaml
index d61d1a2..4628665 100644
--- a/roles_data_undercloud.yaml
+++ b/roles_data_undercloud.yaml
@@ -42,6 +42,7 @@
- OS::TripleO::Services::NovaPlacement
- OS::TripleO::Services::NovaScheduler
- OS::TripleO::Services::Ntp
+ - OS::TripleO::Services::ContainersLogrotateCrond
- OS::TripleO::Services::RabbitMQ
- OS::TripleO::Services::SwiftProxy
- OS::TripleO::Services::SwiftRingBuilder