diff options
Diffstat (limited to 'ci')
-rw-r--r-- | ci/ansible/roles/cleaner/tasks/main.yml | 2 | ||||
-rw-r--r-- | ci/ansible/roles/osdsdb/scenarios/container.yml | 2 | ||||
-rw-r--r-- | ci/ansible/roles/osdsdb/scenarios/etcd_aarch64.yml | 39 | ||||
-rw-r--r-- | ci/ansible/roles/osdsdb/tasks/main.yml | 5 |
4 files changed, 45 insertions, 3 deletions
diff --git a/ci/ansible/roles/cleaner/tasks/main.yml b/ci/ansible/roles/cleaner/tasks/main.yml index 4b3b0c2..0f65d7e 100644 --- a/ci/ansible/roles/cleaner/tasks/main.yml +++ b/ci/ansible/roles/cleaner/tasks/main.yml @@ -28,7 +28,7 @@ - name: kill etcd containerized service
docker:
- image: quay.io/coreos/etcd:latest
+ image: {{ etcd_docker_image }}
state: stopped
when: db_driver == "etcd" and container_enabled == true
diff --git a/ci/ansible/roles/osdsdb/scenarios/container.yml b/ci/ansible/roles/osdsdb/scenarios/container.yml index afbd15b..a5c71d9 100644 --- a/ci/ansible/roles/osdsdb/scenarios/container.yml +++ b/ci/ansible/roles/osdsdb/scenarios/container.yml @@ -2,7 +2,7 @@ - name: run etcd containerized service
docker:
name: myetcd
- image: quay.io/coreos/etcd:latest
+ image: {{ etcd_docker_image }}
command: /usr/local/bin/etcd --advertise-client-urls http://{{ etcd_host }}:{{ etcd_port }} --listen-client-urls http://{{ etcd_host }}:{{ etcd_port }} -advertise-client-urls http://{{ etcd_host }}:{{ etcd_peer_port }} -listen-peer-urls http://{{ etcd_host }}:{{ etcd_peer_port }}
state: started
net: host
diff --git a/ci/ansible/roles/osdsdb/scenarios/etcd_aarch64.yml b/ci/ansible/roles/osdsdb/scenarios/etcd_aarch64.yml new file mode 100644 index 0000000..f3600d8 --- /dev/null +++ b/ci/ansible/roles/osdsdb/scenarios/etcd_aarch64.yml @@ -0,0 +1,39 @@ +--- +- name: check for etcd existed + stat: + path: "{{ etcd_dir }}/etcd" + ignore_errors: yes + register: etcdexisted + +- name: download etcd + get_url: + url={{ etcd_download_url }} + dest=/opt/{{ etcd_tarball }} + when: + - etcdexisted.stat.exists is undefined or etcdexisted.stat.exists == false + +- name: extract the etcd tarball + unarchive: + src=/opt/{{ etcd_tarball }} + dest=/opt/ + when: + - etcdexisted.stat.exists is undefined or etcdexisted.stat.exists == false + +- name: Check if etcd is running + shell: ps aux | grep etcd | grep -v grep + ignore_errors: true + register: service_etcd_status + +- name: run etcd daemon service + shell: ETCD_UNSUPPORTED_ARCH=arm64 nohup ./etcd --advertise-client-urls http://{{ etcd_host }}:{{ etcd_port }} --listen-client-urls http://{{ etcd_host }}:{{ etcd_port }} -listen-peer-urls http://{{ etcd_host }}:{{ etcd_peer_port }} &>>etcd.log & + become: true + args: + chdir: "{{ etcd_dir }}" + when: service_etcd_status.rc != 0 + +- name: check etcd cluster health + shell: ./etcdctl --endpoints http://{{ etcd_host }}:{{ etcd_port }} cluster-health + become: true + ignore_errors: true + args: + chdir: "{{ etcd_dir }}" diff --git a/ci/ansible/roles/osdsdb/tasks/main.yml b/ci/ansible/roles/osdsdb/tasks/main.yml index efbfba9..5b42eaf 100644 --- a/ci/ansible/roles/osdsdb/tasks/main.yml +++ b/ci/ansible/roles/osdsdb/tasks/main.yml @@ -1,6 +1,9 @@ ---
- name: include scenarios/etcd.yml
- include: scenarios/etcd.yml
+ include: "{{ item }}"
+ with_first_found:
+ - "scenarios/etcd_{{ ansible_architecture }}.yml"
+ - "scenarios/etcd.yml"
when: db_driver == "etcd" and container_enabled == false
- name: include scenarios/container.yml
|