---
- name: install memcached server package
  yum: state=present name=memcached
  tags:
  - packages
  - memcached

- name: setup memcached sysconfig
  template: src=memcached dest=/etc/sysconfig/memcached mode=644
  notify:
  - restart memcached
  tags:
  - config
  - memcached

- name: enable memcached service
  service: state=running enabled=true name=memcached
  tags:
  - service
  - config
  - memcached

- name: make systemd override dir
  file: state=directory path=/etc/systemd/system/memcached.d mode=0755 owner=root group=root
  tags:
  - memcached

- name: make systemd override config
  copy: src=memcached-systemdoverride.conf dest=/etc/systemd/system/memcached.d/
  tags:
  - memcached
  notify:
  - reload systemd
