Merge "Add cron image and playbook"
This commit is contained in:
commit
a28b246259
@ -13,3 +13,7 @@ ansible_image_full: "{{ ansible_image }}:{{ ansible_tag }}"
|
|||||||
heka_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-heka"
|
heka_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-heka"
|
||||||
heka_tag: "{{ openstack_release }}"
|
heka_tag: "{{ openstack_release }}"
|
||||||
heka_image_full: "{{ heka_image }}:{{ heka_tag }}"
|
heka_image_full: "{{ heka_image }}:{{ heka_tag }}"
|
||||||
|
|
||||||
|
cron_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-cron"
|
||||||
|
cron_tag: "{{ openstack_release }}"
|
||||||
|
cron_image_full: "{{ cron_image }}:{{ cron_tag }}"
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
recurse: yes
|
recurse: yes
|
||||||
with_items:
|
with_items:
|
||||||
- "heka"
|
- "heka"
|
||||||
|
- "cron"
|
||||||
|
- "cron/logrotate"
|
||||||
|
|
||||||
- name: Copying over config.json files for services
|
- name: Copying over config.json files for services
|
||||||
template:
|
template:
|
||||||
@ -13,6 +15,7 @@
|
|||||||
dest: "{{ node_config_directory }}/{{ item }}/config.json"
|
dest: "{{ node_config_directory }}/{{ item }}/config.json"
|
||||||
with_items:
|
with_items:
|
||||||
- "heka"
|
- "heka"
|
||||||
|
- "cron"
|
||||||
|
|
||||||
- name: Copying over heka config files
|
- name: Copying over heka config files
|
||||||
template:
|
template:
|
||||||
@ -55,3 +58,26 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- "elasticsearch"
|
- "elasticsearch"
|
||||||
when: "{{ enable_central_logging | bool }}"
|
when: "{{ enable_central_logging | bool }}"
|
||||||
|
|
||||||
|
- name: Copying over cron logrotate config files
|
||||||
|
template:
|
||||||
|
src: "cron-logrotate-{{ item }}.conf.j2"
|
||||||
|
dest: "{{ node_config_directory }}/cron/logrotate/{{ item }}.conf"
|
||||||
|
with_items:
|
||||||
|
- "ansible"
|
||||||
|
- "cinder"
|
||||||
|
- "glance"
|
||||||
|
- "global"
|
||||||
|
- "haproxy"
|
||||||
|
- "heat"
|
||||||
|
- "keepalived"
|
||||||
|
- "keystone"
|
||||||
|
- "magnum"
|
||||||
|
- "manila"
|
||||||
|
- "mariadb"
|
||||||
|
- "mistral"
|
||||||
|
- "murano"
|
||||||
|
- "neutron"
|
||||||
|
- "nova"
|
||||||
|
- "rabbitmq"
|
||||||
|
- "swift"
|
||||||
|
@ -28,3 +28,14 @@
|
|||||||
- "/dev/:/dev/"
|
- "/dev/:/dev/"
|
||||||
- "/run/:/run/"
|
- "/run/:/run/"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
|
||||||
|
- name: Starting cron container
|
||||||
|
kolla_docker:
|
||||||
|
action: "start_container"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ cron_image_full }}"
|
||||||
|
name: "cron"
|
||||||
|
volumes:
|
||||||
|
- "{{ node_config_directory }}/cron/:{{ container_config_directory }}/:ro"
|
||||||
|
- "heka_socket:/var/lib/kolla/heka/"
|
||||||
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/ansible.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/cinder/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/glance/*.log"
|
||||||
|
{
|
||||||
|
}
|
21
ansible/roles/common/templates/cron-logrotate-global.conf.j2
Normal file
21
ansible/roles/common/templates/cron-logrotate-global.conf.j2
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
weekly
|
||||||
|
|
||||||
|
rotate 6
|
||||||
|
|
||||||
|
copytruncate
|
||||||
|
|
||||||
|
compress
|
||||||
|
|
||||||
|
delaycompress
|
||||||
|
|
||||||
|
notifempty
|
||||||
|
|
||||||
|
missingok
|
||||||
|
|
||||||
|
minsize 30M
|
||||||
|
|
||||||
|
maxsize 100M
|
||||||
|
|
||||||
|
su root kolla
|
||||||
|
|
||||||
|
include /etc/logrotate.d
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/haproxy/haproxy.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/heat/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/haproxy/keepalived.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
{% set apache_dir = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %}
|
||||||
|
"/var/log/kolla/keystone/*.log"
|
||||||
|
"/var/log/kolla/{{ apache_dir }}/keystone-apache-*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/magnum/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/manila/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/mariadb/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/mistral/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/murano/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/neutron/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/nova/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/rabbitmq/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/swift/*.log"
|
||||||
|
{
|
||||||
|
}
|
22
ansible/roles/common/templates/cron.json.j2
Normal file
22
ansible/roles/common/templates/cron.json.j2
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{% set cron_cmd = 'cron -f' if kolla_base_distro in ['ubuntu', 'debian'] else 'crond -s -n' %}
|
||||||
|
{% set services = ["ansible", "cinder", "glance", "haproxy", "heat", "keepalived", "keystone", "magnum", "manila", "mariadb", "mistral", "murano", "neutron", "nova", "rabbitmq", "swift"] %}
|
||||||
|
{
|
||||||
|
"command": "{{ cron_cmd }}",
|
||||||
|
"config_files": [
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/logrotate/global.conf",
|
||||||
|
"dest": "/etc/logrotate.conf",
|
||||||
|
"owner": "root",
|
||||||
|
"perm": "0644"
|
||||||
|
},
|
||||||
|
{% for service in services %}
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/logrotate/{{ service }}.conf",
|
||||||
|
"dest": "/etc/logrotate.d/{{ service }}.conf",
|
||||||
|
"owner": "root",
|
||||||
|
"perm": "0644"
|
||||||
|
}{% if not loop.last %},{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
@ -9,5 +9,6 @@ filename = "lua_decoders/os_keystone_apache_log.lua"
|
|||||||
type = "LogstreamerInput"
|
type = "LogstreamerInput"
|
||||||
decoder = "keystone_apache_log_decoder"
|
decoder = "keystone_apache_log_decoder"
|
||||||
log_directory = "/var/log/kolla"
|
log_directory = "/var/log/kolla"
|
||||||
file_match = '{{ apache_dir }}/keystone-apache-(?P<Service>.+)-access\.log'
|
file_match = '{{ apache_dir }}/keystone-apache-(?P<Service>.+)-access\.log\.?(?P<Seq>\d*)$'
|
||||||
|
priority = ["^Seq"]
|
||||||
differentiator = ["keystone-apache-", "Service"]
|
differentiator = ["keystone-apache-", "Service"]
|
||||||
|
@ -6,5 +6,6 @@ filename = "lua_decoders/os_mysql_log.lua"
|
|||||||
type = "LogstreamerInput"
|
type = "LogstreamerInput"
|
||||||
decoder = "mariadb_log_decoder"
|
decoder = "mariadb_log_decoder"
|
||||||
log_directory = "/var/log/kolla"
|
log_directory = "/var/log/kolla"
|
||||||
file_match = 'mariadb/mariadb\.log'
|
file_match = 'mariadb/mariadb\.log\.?(?P<Seq>\d*)$'
|
||||||
|
priority = ["^Seq"]
|
||||||
differentiator = ['mariadb']
|
differentiator = ['mariadb']
|
||||||
|
@ -6,5 +6,6 @@ filename = "lua_decoders/os_openstack_log.lua"
|
|||||||
type = "LogstreamerInput"
|
type = "LogstreamerInput"
|
||||||
decoder = "openstack_log_decoder"
|
decoder = "openstack_log_decoder"
|
||||||
log_directory = "/var/log/kolla"
|
log_directory = "/var/log/kolla"
|
||||||
file_match = '(?P<Service>nova|glance|keystone|neutron|cinder|heat|murano|magnum|mistral|manila)/(?P<Program>.*)\.log'
|
file_match = '(?P<Service>nova|glance|keystone|neutron|cinder|heat|murano|magnum|mistral|manila)/(?P<Program>.*)\.log\.?(?P<Seq>\d*)$'
|
||||||
|
priority = ["^Seq"]
|
||||||
differentiator = ["Service", "_", "Program"]
|
differentiator = ["Service", "_", "Program"]
|
||||||
|
@ -13,5 +13,6 @@ type = "LogstreamerInput"
|
|||||||
decoder = "rabbitmq_log_decoder"
|
decoder = "rabbitmq_log_decoder"
|
||||||
splitter = "rabbitmq_log_splitter"
|
splitter = "rabbitmq_log_splitter"
|
||||||
log_directory = "/var/log/kolla"
|
log_directory = "/var/log/kolla"
|
||||||
file_match = 'rabbitmq/(?P<Service>rabbit.*)\.log'
|
file_match = 'rabbitmq/(?P<Service>rabbit.*)\.log\.?(?P<Seq>\d*)$'
|
||||||
|
priority = ["^Seq"]
|
||||||
differentiator = ["Service"]
|
differentiator = ["Service"]
|
||||||
|
23
docker/cron/Dockerfile.j2
Normal file
23
docker/cron/Dockerfile.j2
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
|
||||||
|
MAINTAINER {{ maintainer }}
|
||||||
|
|
||||||
|
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
|
||||||
|
|
||||||
|
RUN yum -y install \
|
||||||
|
cronie \
|
||||||
|
logrotate \
|
||||||
|
&& yum clean all
|
||||||
|
|
||||||
|
{% elif base_distro in ['ubuntu', 'debian'] %}
|
||||||
|
|
||||||
|
RUN apt-get install -y --no-install-recommends \
|
||||||
|
cron \
|
||||||
|
logrotate \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
||||||
|
RUN chmod 755 /usr/local/bin/kolla_extend_start
|
||||||
|
|
||||||
|
{{ include_footer }}
|
7
docker/cron/extend_start.sh
Normal file
7
docker/cron/extend_start.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# NOTE(elemoine): the cron daemon sends its logs to /dev/log. Heka's log socket
|
||||||
|
# is at /var/lib/kolla/heka/log so we symlink /dev/log to that location.
|
||||||
|
if [[ ! -h /dev/log ]]; then
|
||||||
|
ln -sf /var/lib/kolla/heka/log /dev/log
|
||||||
|
fi
|
@ -25,7 +25,7 @@ INSTALL_TYPE_CHOICES = ['binary', 'source', 'rdo', 'rhos']
|
|||||||
|
|
||||||
_PROFILE_OPTS = [
|
_PROFILE_OPTS = [
|
||||||
cfg.ListOpt('infra',
|
cfg.ListOpt('infra',
|
||||||
default=['ceph', 'mariadb', 'haproxy',
|
default=['ceph', 'cron', 'mariadb', 'haproxy',
|
||||||
'keepalived', 'kolla-toolbox', 'memcached',
|
'keepalived', 'kolla-toolbox', 'memcached',
|
||||||
'mongodb', 'openvswitch', 'rabbitmq', 'heka'],
|
'mongodb', 'openvswitch', 'rabbitmq', 'heka'],
|
||||||
help='Infra images'),
|
help='Infra images'),
|
||||||
@ -39,13 +39,13 @@ _PROFILE_OPTS = [
|
|||||||
'magnum', 'mistral', 'trove,' 'zaqar', 'zookeeper'],
|
'magnum', 'mistral', 'trove,' 'zaqar', 'zookeeper'],
|
||||||
help='Aux Images'),
|
help='Aux Images'),
|
||||||
cfg.ListOpt('default',
|
cfg.ListOpt('default',
|
||||||
default=['kolla-toolbox', 'glance', 'haproxy',
|
default=['cron', 'kolla-toolbox', 'glance', 'haproxy',
|
||||||
'heat', 'horizon', 'keepalived', 'keystone',
|
'heat', 'horizon', 'keepalived', 'keystone',
|
||||||
'memcached', 'mariadb', 'neutron', 'nova',
|
'memcached', 'mariadb', 'neutron', 'nova',
|
||||||
'openvswitch', 'rabbitmq', 'heka'],
|
'openvswitch', 'rabbitmq', 'heka'],
|
||||||
help='Default images'),
|
help='Default images'),
|
||||||
cfg.ListOpt('gate',
|
cfg.ListOpt('gate',
|
||||||
default=['glance', 'haproxy', 'keepalived', 'keystone',
|
default=['cron', 'glance', 'haproxy', 'keepalived', 'keystone',
|
||||||
'kolla-toolbox', 'mariadb', 'memcached', 'neutron',
|
'kolla-toolbox', 'mariadb', 'memcached', 'neutron',
|
||||||
'nova', 'openvswitch', 'rabbitmq', 'heka'],
|
'nova', 'openvswitch', 'rabbitmq', 'heka'],
|
||||||
help='Gate images'),
|
help='Gate images'),
|
||||||
|
@ -14,6 +14,7 @@ else
|
|||||||
bootstrap_{ceph_mon,cinder,glance,heat,heka,ironic,ironic_pxe,keystone,magnum,mistral,mongodb,murano,neutron,nova,nova_compute} \
|
bootstrap_{ceph_mon,cinder,glance,heat,heka,ironic,ironic_pxe,keystone,magnum,mistral,mongodb,murano,neutron,nova,nova_compute} \
|
||||||
cinder_{volume,scheduler,backup,api} \
|
cinder_{volume,scheduler,backup,api} \
|
||||||
ceph_{mon,rgw} \
|
ceph_{mon,rgw} \
|
||||||
|
cron \
|
||||||
elasticsearch \
|
elasticsearch \
|
||||||
glance_{api,registry} \
|
glance_{api,registry} \
|
||||||
haproxy \
|
haproxy \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user