Replace config-external - memcached

Change-Id: I83094d1fc98c79c74d6c9fdc68aa224ae4a6d672
Partially-Implements: blueprint replace-config-external
This commit is contained in:
Sam Yaple 2015-09-25 10:16:59 +00:00
parent 4d5186473e
commit 9b18d2d28b
5 changed files with 13 additions and 19 deletions

View File

@ -5,7 +5,7 @@
state: "directory" state: "directory"
recurse: "yes" recurse: "yes"
- name: Copying over config(s) - name: Copying over memcached JSON configuration file
template: template:
src: "memcached.conf.j2" src: "memcached.json.j2"
dest: "{{ node_config_directory }}/memcached/memcached.conf" dest: "{{ node_config_directory }}/memcached/config.json"

View File

@ -13,7 +13,7 @@
insecure_registry: "{{ docker_insecure_registry }}" insecure_registry: "{{ docker_insecure_registry }}"
name: memcached name: memcached
image: "{{ memcached_image_full }}" image: "{{ memcached_image_full }}"
volumes: "{{ node_config_directory }}/memcached/:/opt/kolla/memcached/:ro" volumes: "{{ node_config_directory }}/memcached/:/opt/kolla/config_files/:ro"
env: env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['memcached'] when: inventory_hostname in groups['memcached']

View File

@ -1 +0,0 @@
OPTIONS="-l {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} -p {{ memcached_port }}"

View File

@ -0,0 +1,5 @@
{% set memcache_user = 'memcache' if kolla_base_distro in ['ubuntu', 'debian'] else 'memcached' %}
{
"command": "/usr/bin/memcached -u {{ memcache_user }} -vv -l {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} -p {{ memcached_port }}",
"config_files": []
}

View File

@ -2,21 +2,11 @@
set -o errexit set -o errexit
if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
"${KOLLA_BASE_DISTRO}" == "debian" ]]; then
CMD="/usr/bin/memcached"
ARGS="-u memcache -vv"
else
CMD="/usr/bin/memcached"
ARGS="-u memcached -vv"
fi
# Loading common functions. # Loading common functions.
source /opt/kolla/kolla-common.sh source /opt/kolla/kolla-common.sh
# Execute config strategy # Generate run command
set_configs python /opt/kolla/set_configs.py
CMD=$(cat /run_command)
source /etc/memcached.conf exec $CMD
exec $CMD $ARGS $OPTIONS