Skip to content
Snippets Groups Projects
Commit f70e8d45 authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Add Ansible role for memcached"

parents f14b229b d13163ab
No related branches found
No related tags found
No related merge requests found
......@@ -89,6 +89,8 @@ neutron_server_port: "9696"
cinder_api_port: "8776"
memcached_port: "11211"
####################
# Openstack options
......
......@@ -38,6 +38,9 @@ network
[cinder:children]
control
[memcached:children]
control
# Additional control implemented here. These groups allow you to control which
# services run on which hosts at a per-service level.
......
......@@ -44,6 +44,9 @@ network
[cinder:children]
control
[memcached:children]
control
# Additional control implemented here. These groups allow you to control which
# services run on which hosts at a per-service level.
......
---
project_name: "memcached"
####################
# Docker
####################
memcached_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-memcached"
memcached_tag: "{{ openstack_release }}"
memcached_image_full: "{{ memcached_image }}:{{ memcached_tag }}"
---
- name: Ensuring config directory exists
file:
path: "{{ node_config_directory }}/memcached/"
state: "directory"
recurse: "yes"
- name: Copying over config(s)
template:
src: "memcached.conf.j2"
dest: "{{ node_config_directory }}/memcached/memcached.conf"
---
- include: config.yml
- include: start.yml
---
- name: Starting memcached container
docker:
docker_api_version: "{{ docker_api_version }}"
net: host
pull: "{{ docker_pull_policy }}"
restart_policy: "{{ docker_restart_policy }}"
restart_policy_retry: "{{ docker_restart_policy_retry }}"
state: reloaded
registry: "{{ docker_registry }}"
username: "{{ docker_registry_username }}"
password: "{{ docker_registry_password }}"
insecure_registry: "{{ docker_insecure_registry }}"
name: memcached
image: "{{ memcached_image_full }}"
volumes: "{{ node_config_directory }}/memcached/:/opt/kolla/memcached/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['memcached']
OPTIONS="-l {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} -p {{ memcached_port }}"
#!/bin/bash
SOURCE="/opt/kolla/memcached/memcached"
TARGET="/etc/sysconfig/memcached"
OWNER="swift"
SOURCE="/opt/kolla/memcached/memcached.conf"
TARGET="/etc/memcached.conf"
OWNER="memcached"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
......
......@@ -11,4 +11,6 @@ source /opt/kolla/kolla-common.sh
# Execute config strategy
set_configs
exec $CMD $ARGS
source /etc/memcached.conf
exec $CMD $ARGS $OPTIONS
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment