1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- ---
- # Set some facts to reference from hostvars
- - import_tasks: set_facts.yml
- - name: setup firewall
- import_tasks: firewall.yml
- - name: Install etcd
- package: name=etcd{{ '-' + etcd_version if etcd_version is defined else '' }} state=present
- register: result
- until: result is succeeded
- - include_tasks: drop_etcdctl.yml
- when:
- - openshift_etcd_etcdctl_profile | default(true) | bool
- # Start secondary etcd instance for third party integrations
- # TODO: Determine an alternative to using thirdparty variable
- - block:
- - name: Create configuration directory
- file:
- path: "{{ etcd_conf_dir }}"
- state: directory
- mode: 0700
- # TODO: retest with symlink to confirm it does or does not function
- - name: Copy service file for etcd instance
- copy:
- src: /usr/lib/systemd/system/etcd.service
- dest: "/etc/systemd/system/{{ etcd_service }}.service"
- remote_src: True
- - name: Create third party etcd service.d directory exists
- file:
- path: "{{ etcd_systemd_dir }}"
- state: directory
- - name: Configure third part etcd service unit file
- template:
- dest: "{{ etcd_systemd_dir }}/custom.conf"
- src: custom.conf.j2
- when: etcd_is_thirdparty
- - name: Ensure etcd datadir ownership for thirdparty datadir
- file:
- path: "{{ etcd_data_dir }}"
- state: directory
- mode: 0700
- owner: etcd
- group: etcd
- recurse: True
- when: etcd_is_thirdparty | bool
- - name: Validate permissions on the config dir
- file:
- path: "{{ etcd_conf_dir }}"
- state: directory
- owner: "etcd"
- group: "etcd"
- mode: 0700
- - name: Write etcd global config file
- template:
- src: etcd.conf.j2
- dest: "{{ etcd_conf_file }}"
- backup: true
- notify:
- - restart etcd
- - name: Enable etcd
- systemd:
- name: "{{ etcd_service }}"
- state: started
- enabled: yes
- daemon_reload: yes
- register: start_result
- - name: Set fact etcd_service_status_changed
- set_fact:
- etcd_service_status_changed: "{{ start_result is changed }}"
|