Skip to content

Commit

Permalink
Merge pull request #44 from bai-charisu/master
Browse files Browse the repository at this point in the history
add clean curve at curve-ansible
  • Loading branch information
lixiaocuicoding authored Jul 30, 2020
2 parents 6199d25 + f20e9ec commit f6425ad
Show file tree
Hide file tree
Showing 59 changed files with 1,535 additions and 733 deletions.
397 changes: 269 additions & 128 deletions curve-ansible/README → curve-ansible/README.md

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions curve-ansible/check_ansible_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
#
# Copyright (c) 2020 NetEase Inc.
#
# 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.
#
# The deploy playbook of Curve

# check ansible version
- name: Stop if ansible version not match, make sure that the Ansible version is Ansible 2.5.9
hosts: localhost
gather_facts: no
tasks:
- assert:
that:
- ansible_version.full|version_compare('2.5.9', '==')
93 changes: 93 additions & 0 deletions curve-ansible/clean_curve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
#
# Copyright (c) 2020 NetEase Inc.
#
# 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.
#
# The clean playbook of Curve

- name: check_ansible_version
tags:
- always
import_playbook: check_ansible_version.yml

- name: stop all service
import_playbook: stop_curve.yml

############################## clean etcd ##############################
- name: clean etcd
hosts: etcd
any_errors_fatal: true
gather_facts: no
become: yes
become_user: "{{ sudo_user }}"
become_flags: -iu {{ sudo_user }}
tags:
- etcd
roles:
- { role: clean, module_name: etcd }

############################## deploy mds ##############################
- name: clean mds
hosts: mds
any_errors_fatal: true
gather_facts: no
become: yes
become_user: "{{ sudo_user }}"
become_flags: -iu {{ sudo_user }}
tags:
- mds
roles:
- { role: clean, module_name: mds }


############################## clean chunkserver ##############################
- name: clean chunkserver
hosts: chunkservers
any_errors_fatal: true
gather_facts: no
become: yes
become_user: "{{ sudo_user }}"
become_flags: -iu {{ sudo_user }}
tags:
- chunkserver
roles:
- { role: clean, module_name: chunkserver }

############################## clean snapshotcloneserver ##############################
- name: clean snapshotcloneserver
hosts: snapshotclone
any_errors_fatal: true
gather_facts: no
become: yes
become_user: "{{ sudo_user }}"
become_flags: -iu {{ sudo_user }}
tags:
- snapshotclone
- never
roles:
- { role: clean, module_name: snapshotcloneserver }

############################## clean snapshotcloneserver_nginx ##############################
- name: clean snapshotcloneserver_nginx
hosts: snapshotclone_nginx
any_errors_fatal: true
gather_facts: no
become: yes
become_user: "{{ sudo_user }}"
become_flags: -iu {{ sudo_user }}
tags:
- snapshotclone_nginx
- never
roles:
- { role: clean, module_name: snapshotcloneserver_nginx }
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Copyright 2020 NetEase, Inc.
# The deploy playbook of Curve

# 部署etcd
- name: prepare etcd
hosts: etcd
any_errors_fatal: true
gather_facts: no
become: yes
become_user: "{{ sudo_user }}"
become_flags: -iu {{ sudo_user }}
- name: check_ansible_version
tags:
- prepare
roles:
- { role: install_package, package_name: etcd, install_with_deb: false, tags: install_etcd }
- { role: generate_config, template_name: etcd.conf.yml, conf_path: "{{ etcd_config_path }}", tags: generage_config }
- always
import_playbook: check_ansible_version.yml

- name: start etcd
hosts: etcd
any_errors_fatal: true
- name: clean curve_sdk
hosts: client
gather_facts: no
become: yes
become_user: "{{ sudo_user }}"
become_flags: -iu {{ sudo_user }}
any_errors_fatal: true
tags:
- start
- prepare
roles:
- { role: start_service, service_name: etcd, command_need_sudo: "{{ etcd_need_sudo }}" }
- { role: clean, module_name: curve_sdk }
31 changes: 31 additions & 0 deletions curve-ansible/clean_nebd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
#
# Copyright (c) 2020 NetEase Inc.
#
# 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.
#
# The deploy playbook of Curve

- name: check_ansible_version
tags:
- always
import_playbook: check_ansible_version.yml

- name: clean nebd
hosts: client
gather_facts: no
any_errors_fatal: true
tags:
- prepare
roles:
- { role: clean, module_name: nebd }
2 changes: 1 addition & 1 deletion curve-ansible/common_tasks/wait_until_server_down.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
host: "{{ ansible_ssh_host }}"
port: "{{ ping_port }}"
state: stopped
msg: "the server {{ ansible_host }}:{{ ping_port }} is down"
timeout: "{{ wait_service_timeout }}"
65 changes: 0 additions & 65 deletions curve-ansible/deploy_chunkserver.yml

This file was deleted.

Loading

0 comments on commit f6425ad

Please sign in to comment.