diff --git a/ansible_3par_docker_plugin/README.md b/ansible_3par_docker_plugin/README.md index 14d0b056..b8643c9c 100644 --- a/ansible_3par_docker_plugin/README.md +++ b/ansible_3par_docker_plugin/README.md @@ -63,6 +63,9 @@ These playbooks perform the following tasks on the Master/Worker nodes as define | ```etcd_client_port_1``` | Yes | 23790 | | ```etcd_client_port_2``` | Yes | 40010 | + - The Etcd data directory for backup and restore can be modified in [etcd cluster properties](/ansible_3par_docker_plugin/properties/etcd_cluster_properties.yml) + e.g. etcd_data_directory=/var/lib/etcd + > **Note:** Please ensure that the ports specified above are unoccupied before installation. If the ports are not available on a particular node, etcd installation will fail. > **Limitation:** The installer, in the current state does not have the capability to add or remove nodes in the etcd cluster. In case an etcd node is not responding or goes down, it is beyond the current scope to admit it back into the cluster. Please follow the [etcd documentation](https://coreos.com/etcd/docs/latest/etcd-live-cluster-reconfiguration.html) to do so manually. diff --git a/ansible_3par_docker_plugin/install_standalone_hpe_3par_volume_driver.yml b/ansible_3par_docker_plugin/install_standalone_hpe_3par_volume_driver.yml index dd10af05..6ac495de 100644 --- a/ansible_3par_docker_plugin/install_standalone_hpe_3par_volume_driver.yml +++ b/ansible_3par_docker_plugin/install_standalone_hpe_3par_volume_driver.yml @@ -122,6 +122,8 @@ - "{{ etcd_peer_port }}:{{ etcd_peer_port }}" - "{{ etcd_client_port_1 }}:{{ etcd_client_port_1 }}" - "{{ etcd_client_port_2 }}:{{ etcd_client_port_2 }}" + volumes: + - "{{etcd_data_dir}}:/etcd-data" env: ETCD_NAME: etcd0 ETCD_ADVERTISE_CLIENT_URLS: "{{ etcd_advertise_client_url_1 }},{{ etcd_advertise_client_url_2 }}" @@ -130,6 +132,7 @@ ETCD_LISTEN_PEER_URLS: "{{ etcd_listen_peer_urls }}" ETCD_INITIAL_CLUSTER: "etcd0=http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ etcd_peer_port }}" ETCD_INITIAL_CLUSTER_TOKEN: "{{ etcd_initial_cluster_token }}" + ETCD_DATA_DIR: /etcd-data ETCD_INITIAL_CLUSTER_STATE: "{{ etcd_initial_cluster_state }}" restart_policy: always become: yes diff --git a/ansible_3par_docker_plugin/properties/etcd_cluster_properties.yml b/ansible_3par_docker_plugin/properties/etcd_cluster_properties.yml index 61de0903..e4267fca 100644 --- a/ansible_3par_docker_plugin/properties/etcd_cluster_properties.yml +++ b/ansible_3par_docker_plugin/properties/etcd_cluster_properties.yml @@ -20,6 +20,7 @@ etcd_client_port_1: 23790 etcd_client_port_2: 40010 etcd_url_scheme: http etcd_peer_port: 23800 +etcd_data_directory: /var/lib/etcd etcd_name: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}" etcd_advertise_client_url_1: "{{ etcd_url_scheme }}://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ etcd_client_port_1 }}" @@ -29,4 +30,5 @@ etcd_listen_client_url_2: "{{ etcd_url_scheme }}://0.0.0.0:{{ etcd_client_port_2 etcd_initial_advertise_peer_urls: "{{ etcd_url_scheme }}://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ etcd_peer_port }}" etcd_listen_peer_urls: "{{ etcd_url_scheme }}://0.0.0.0:{{ etcd_peer_port }}" etcd_initial_cluster_token: etcd-cluster-1 +etcd_data_dir: "{{etcd_data_directory}}" etcd_initial_cluster_state: "new" diff --git a/ansible_3par_docker_plugin/tasks/create_etcd_container.yml b/ansible_3par_docker_plugin/tasks/create_etcd_container.yml index 3b5b18d7..71746392 100644 --- a/ansible_3par_docker_plugin/tasks/create_etcd_container.yml +++ b/ansible_3par_docker_plugin/tasks/create_etcd_container.yml @@ -22,6 +22,8 @@ - "{{ etcd_peer_port }}:{{ etcd_peer_port }}" - "{{ etcd_client_port_1 }}:{{ etcd_client_port_1 }}" - "{{ etcd_client_port_2 }}:{{ etcd_client_port_2 }}" + volumes: + - "{{etcd_data_dir}}:/etcd-data" env: ETCD_NAME: "{{ etcd_name }}" ETCD_ADVERTISE_CLIENT_URLS: "{{ etcd_advertise_client_url_1 }},{{ etcd_advertise_client_url_2 }}" @@ -30,5 +32,6 @@ ETCD_LISTEN_PEER_URLS: "{{ etcd_listen_peer_urls }}" ETCD_INITIAL_CLUSTER: "{{ etcd_initial_cluster[1:] }}" ETCD_INITIAL_CLUSTER_TOKEN: "{{ etcd_initial_cluster_token }}" + ETCD_DATA_DIR: /etcd-data ETCD_INITIAL_CLUSTER_STATE: "{{ etcd_initial_cluster_state }}" restart_policy: always