--- /dev/null
+---
+# Copyright 2019 Nokia
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+- name: Add member
+ shell: 'echo $(docker exec -t {{ etcd_container_id_outer }} etcdctl3 member add etcd{{ expected_etcd_number }} --peer-urls="https://{{ etcd_address_add_member }}:{{ caas.etcd_peer_port}}")'
+ environment:
+ DOCKER_HOST: "tcp://{{ networking.infra_internal.ip }}:2375"
+ DOCKER_TLS_VERIFY: "1"
+ DOCKER_CERT_PATH: "/etc/docker"
+ register: member_add_result
+ until: (member_add_result.stdout.find("exists") != -1 ) or (member_add_result.stdout.find("added") != -1 )
+ delay: 10
+ retries: 100
+
+- name: Check if member is added successfuly
+ shell: 'docker exec -t {{ etcd_container_id_outer }} etcdctl3 member list | grep -i https | wc -l'
+ environment:
+ DOCKER_HOST: "tcp://{{ networking.infra_internal.ip }}:2375"
+ DOCKER_TLS_VERIFY: "1"
+ DOCKER_CERT_PATH: "/etc/docker"
+ register: addresult
+
+- set_fact:
+ current_cluster_size: "{{ addresult.stdout }}"