You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
721 B
23 lines
721 B
---
|
|
|
|
- name: Install packages
|
|
yum:
|
|
name:
|
|
- memcached
|
|
- libmemcached
|
|
|
|
- name: Deploy configuration
|
|
template: src=memcached.j2 dest=/etc/sysconfig/memcached
|
|
notify: restart memcached
|
|
|
|
- name: Handle memcached ports
|
|
iptables_raw:
|
|
name: memcached_ports
|
|
state: "{{ (memcached_src_ip | length > 0) | ternary('present','absent') }}"
|
|
rules: |
|
|
-A INPUT -m state --state NEW -p tcp --dport {{ memcached_port }} -s {{ memcached_src_ip | join(',') }} -j ACCEPT
|
|
-A INPUT -p udp --dport {{ memcached_port }} -s {{ memcached_src_ip | join(',') }} -j ACCEPT
|
|
when: iptables_manage | default(True)
|
|
|
|
- name: Start and enabled the service
|
|
service: name=memcached state=started enabled=yes
|
|
|