rpm.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ---
  2. # Set some facts to reference from hostvars
  3. - import_tasks: set_facts.yml
  4. - name: setup firewall
  5. import_tasks: firewall.yml
  6. - name: Install etcd
  7. package: name=etcd{{ '-' + etcd_version if etcd_version is defined else '' }} state=present
  8. register: result
  9. until: result is succeeded
  10. - include_tasks: drop_etcdctl.yml
  11. when:
  12. - openshift_etcd_etcdctl_profile | default(true) | bool
  13. # Start secondary etcd instance for third party integrations
  14. # TODO: Determine an alternative to using thirdparty variable
  15. - block:
  16. - name: Create configuration directory
  17. file:
  18. path: "{{ etcd_conf_dir }}"
  19. state: directory
  20. mode: 0700
  21. # TODO: retest with symlink to confirm it does or does not function
  22. - name: Copy service file for etcd instance
  23. copy:
  24. src: /usr/lib/systemd/system/etcd.service
  25. dest: "/etc/systemd/system/{{ etcd_service }}.service"
  26. remote_src: True
  27. - name: Create third party etcd service.d directory exists
  28. file:
  29. path: "{{ etcd_systemd_dir }}"
  30. state: directory
  31. - name: Configure third part etcd service unit file
  32. template:
  33. dest: "{{ etcd_systemd_dir }}/custom.conf"
  34. src: custom.conf.j2
  35. when: etcd_is_thirdparty
  36. - name: Ensure etcd datadir ownership for thirdparty datadir
  37. file:
  38. path: "{{ etcd_data_dir }}"
  39. state: directory
  40. mode: 0700
  41. owner: etcd
  42. group: etcd
  43. recurse: True
  44. when: etcd_is_thirdparty | bool
  45. - name: Validate permissions on the config dir
  46. file:
  47. path: "{{ etcd_conf_dir }}"
  48. state: directory
  49. owner: "etcd"
  50. group: "etcd"
  51. mode: 0700
  52. - name: Write etcd global config file
  53. template:
  54. src: etcd.conf.j2
  55. dest: "{{ etcd_conf_file }}"
  56. backup: true
  57. notify:
  58. - restart etcd
  59. - name: Enable etcd
  60. systemd:
  61. name: "{{ etcd_service }}"
  62. state: started
  63. enabled: yes
  64. daemon_reload: yes
  65. register: start_result
  66. - name: Set fact etcd_service_status_changed
  67. set_fact:
  68. etcd_service_status_changed: "{{ start_result is changed }}"