main.yml 984 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ---
  2. - name: Install etcd
  3. yum: pkg=etcd state=present
  4. - name: Validate permissions on the config dir
  5. file:
  6. path: "{{ etcd_conf_dir }}"
  7. state: directory
  8. owner: etcd
  9. group: etcd
  10. mode: 0700
  11. - name: Validate permissions on certificate files
  12. file:
  13. path: "{{ item }}"
  14. mode: 0600
  15. group: etcd
  16. owner: etcd
  17. when: etcd_url_scheme == 'https'
  18. with_items:
  19. - "{{ etcd_ca_file }}"
  20. - "{{ etcd_cert_file }}"
  21. - "{{ etcd_key_file }}"
  22. - name: Validate permissions on peer certificate files
  23. file:
  24. path: "{{ item }}"
  25. mode: 0600
  26. group: etcd
  27. owner: etcd
  28. when: etcd_peer_url_scheme == 'https'
  29. with_items:
  30. - "{{ etcd_peer_ca_file }}"
  31. - "{{ etcd_peer_cert_file }}"
  32. - "{{ etcd_peer_key_file }}"
  33. - name: Write etcd global config file
  34. template:
  35. src: etcd.conf.j2
  36. dest: /etc/etcd/etcd.conf
  37. notify:
  38. - restart etcd
  39. - name: Enable etcd
  40. service:
  41. name: etcd
  42. state: started
  43. enabled: yes
  44. - pause: seconds=10