From 89508d7bfc5ce48d189ee310697d4e26498e4822 Mon Sep 17 00:00:00 2001 From: "bhagyashree.sarawate" Date: Mon, 10 Jun 2019 17:15:38 +0530 Subject: [PATCH 1/2] Added data dir parameter while creating etcd container --- ansible_3par_docker_plugin/README.md | 3 +++ .../install_standalone_hpe_3par_volume_driver.yml | 1 + .../properties/etcd_cluster_properties.yml | 2 ++ ansible_3par_docker_plugin/tasks/create_etcd_container.yml | 1 + 4 files changed, 7 insertions(+) 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..cc38d975 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 @@ -130,6 +130,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_dir }}" 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..c572cb1b 100644 --- a/ansible_3par_docker_plugin/tasks/create_etcd_container.yml +++ b/ansible_3par_docker_plugin/tasks/create_etcd_container.yml @@ -30,5 +30,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_dir }}" ETCD_INITIAL_CLUSTER_STATE: "{{ etcd_initial_cluster_state }}" restart_policy: always From 3fdc5d4d0cfe5eb3fa3e89781c79756aa0cdcce9 Mon Sep 17 00:00:00 2001 From: "bhagyashree.sarawate" Date: Tue, 11 Jun 2019 14:18:55 +0530 Subject: [PATCH 2/2] For Issue #611 added --data-dir as part of etcd container creation with volume mapping --- .../install_standalone_hpe_3par_volume_driver.yml | 4 +++- ansible_3par_docker_plugin/tasks/create_etcd_container.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 cc38d975..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,7 +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_dir }}" + 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/tasks/create_etcd_container.yml b/ansible_3par_docker_plugin/tasks/create_etcd_container.yml index c572cb1b..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,6 +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_dir }}" + ETCD_DATA_DIR: /etcd-data ETCD_INITIAL_CLUSTER_STATE: "{{ etcd_initial_cluster_state }}" restart_policy: always