---
- name: Install etcd
  action: "{{ ansible_pkg_mgr }}"
  args:
        name: etcd
        state: latest
  notify:
    - restart etcd
  when: not is_atomic

- name: Write etcd config file
  template: src=etcd.conf.j2 dest=/etc/etcd/etcd.conf
  notify:
    - restart etcd

- name: Enable etcd
  service: name=etcd enabled=yes

- name: Start etcd
  service: name=etcd state=started
  register: etcd_started

- include: firewalld.yml
  when: has_firewalld

- include: iptables.yml
  when: not has_firewalld and has_iptables
