aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/provision/-redis-setup.yml
blob: c4a662406c528f3a66f33784449330f8e2b20421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
##############################################################################
# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
- name: "stop redis server"
  service:
    name: "redis-server"
    state: "stopped"

- name: "modify redis server configuration"
  replace:
    dest: "/etc/redis/redis.conf"
    regexp: "{{ item.regexp }}"
    replace: "{{ item.replace }}"
  with_items:
    - { regexp: "^\\s*bind", replace: "#bind" }
    - { regexp: "^\\s*save", replace: "#save" }
    - { regexp: "^\\s*dbfilename", replace: "#dbfilename" }
    - { regexp: "^\\s*lua-time-limit\\s*\\d*", replace: "lua-time-limit 15000" }

- name: "delete redis dump"
  file:
    dest: "/var/lib/redis/dump.rdb"
    state: "absent"

- name: "start redis server"
  service:
    name: "redis-server"
    state: "started"