Add chrony docker image

Partially-implements: blueprint add-chrony-service
Change-Id: If8045c62656ffc0090d0c02ca0fbe58ab8c5f29f
This commit is contained in:
Jeffrey Zhang 2016-10-24 15:15:23 +02:00 committed by Jeffrey Zhang
parent 16d772cd53
commit 86a5c8cb79
3 changed files with 39 additions and 6 deletions

View File

@ -0,0 +1,23 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER {{ maintainer }}
{% block chrony_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% set chrony_packages = ['chrony'] %}
{% if base_distro in ['ubuntu', 'debian'] %}
# Ubuntu use _chrony username to use unified running user with RHEL system
RUN useradd --user-group --create-home --home-dir /var/lib/chrony chrony
{% endif %}
{{ macros.install_packages(chrony_packages | customizable("packages")) }}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start \
&& usermod -a -G kolla chrony
{% block chrony_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}

View File

@ -0,0 +1,10 @@
#!/bin/bash
rm -f /var/run/chronyd.pid
if [[ ! -d "/var/log/kolla/chrony" ]]; then
mkdir -p /var/log/kolla/chrony
fi
if [[ $(stat -c %a /var/log/kolla/chrony) != "755" ]]; then
chmod 755 /var/log/kolla/chrony
fi

View File

@ -52,15 +52,15 @@ _PROFILE_OPTS = [
'zaqar'],
help='Aux Images'),
cfg.ListOpt('default',
default=['cron', 'kolla-toolbox', 'glance', 'haproxy',
'heat', 'horizon', 'keepalived', 'keystone',
'memcached', 'mariadb', 'neutron', 'nova',
default=['chrony', 'cron', 'kolla-toolbox', 'glance',
'haproxy', 'heat', 'horizon', 'keepalived',
'keystone', 'memcached', 'mariadb', 'neutron', 'nova',
'openvswitch', 'rabbitmq', 'heka'],
help='Default images'),
cfg.ListOpt('gate',
default=['cron', 'glance', 'haproxy', 'keepalived', 'keystone',
'kolla-toolbox', 'mariadb', 'memcached', 'neutron',
'nova', 'openvswitch', 'rabbitmq', 'heka'],
default=['chrony', 'cron', 'glance', 'haproxy', 'keepalived',
'keystone', 'kolla-toolbox', 'mariadb', 'memcached',
'neutron', 'nova', 'openvswitch', 'rabbitmq', 'heka'],
help='Gate images')
]