summaryrefslogtreecommitdiffstats
path: root/docker/services
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 /docker/services
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>
Diffstat (limited to 'docker/services')
-rw-r--r--docker/services/logrotate-crond.yaml84
1 files changed, 84 insertions, 0 deletions
diff --git a/docker/services/logrotate-crond.yaml b/docker/services/logrotate-crond.yaml
new file mode 100644
index 00000000..f49fd36b
--- /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