Skip to content

Commit 5d15334

Browse files
Wine93ilixiaocui
authored andcommitted
ansible: fixed some ansible bugs
1 parent 563c137 commit 5d15334

14 files changed

+31
-9
lines changed

conf/chunkserver.conf.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ copyset.catchup_margin=1000
7575
# copyset chunk数据目录
7676
copyset.chunk_data_uri=local://./0/copysets
7777
# raft wal log目录
78-
copyset.raft_log_uri=local://./0/copysets
78+
copyset.raft_log_uri=curve://./0/copysets
7979
# raft元数据目录
8080
copyset.raft_meta_uri=local://./0/copysets
8181
# raft snapshot目录

curve-ansible/client.ini

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ wait_service_timeout=20
3636
curve_bin_dir=/usr/bin
3737
start_by_daemon=true
3838
install_with_deb=false
39+
sudo_or_not=True
40+
ansible_become_user=curve
41+
ansible_become_flags=-iu curve

curve-ansible/common_tasks/check_if_nbd_exists_in_kernel.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
- name: check if nbd exists in kernel
19-
shell: /sbin/modprobe nbd
19+
shell: sudo /sbin/modprobe nbd
2020
ignore_errors: true
2121
register: modprobe_res
2222

curve-ansible/deploy_curve.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,20 @@
199199
hosts: snapshotclone_nginx
200200
any_errors_fatal: true
201201
gather_facts: no
202+
become: "{{ sudo_or_not | bool }}"
202203
tags:
203204
- snapshotclone_nginx
204205
- never
205206
roles:
206-
- { role: install_package, package_name: curve-snapshotcloneserver-nginx,
207-
tags: ["install_conf_package", "install_snapshotclone_nginx_conf_package"] }
207+
- {
208+
role: install_package,
209+
package_name: curve-snapshotcloneserver-nginx,
210+
package_version: "{{ snapshot_nginx_package_version }}",
211+
tags: [
212+
"install_conf_package",
213+
"install_snapshotclone_nginx_conf_package"
214+
]
215+
}
208216
- { role: generate_config, template_name: nginx.conf, conf_path: "{{ snapshot_nginx_conf_path }}",
209217
tags: ["generate_config", "generate_snap_nginx_conf"] }
210218
- { role: generate_config, template_name: nginx_config.lua, conf_path: "{{ snapshot_nginx_lua_conf_path}}",

curve-ansible/deploy_curve_sdk.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
hosts: client
2626
any_errors_fatal: true
2727
gather_facts: no
28+
become: "{{ sudo_or_not | bool }}"
2829
tags:
2930
- prepare_software_env
3031
roles:
@@ -34,6 +35,7 @@
3435
hosts: client
3536
gather_facts: no
3637
any_errors_fatal: true
38+
become: "{{ sudo_or_not | bool }}"
3739
tags:
3840
- prepare
3941
vars:
@@ -44,4 +46,4 @@
4446
- { role: install_package, package_name: curve-sdk, package_version: "{{ sdk_package_version }}",
4547
tags: install_package }
4648
- { role: generate_config, template_name: client.conf, conf_path: "{{ py_client_config_path }}",
47-
tags: generate_config }
49+
tags: generate_config }

curve-ansible/deploy_nbd.yml

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
hosts: client
2626
any_errors_fatal: true
2727
gather_facts: yes
28+
become: "{{ sudo_or_not | bool }}"
2829
tags:
2930
- check_kernel_version
3031
tasks:
@@ -39,6 +40,7 @@
3940
hosts: client
4041
any_errors_fatal: true
4142
gather_facts: no
43+
become: "{{ sudo_or_not | bool }}"
4244
tags:
4345
- prepare_software_env
4446
roles:
@@ -48,6 +50,7 @@
4850
hosts: client
4951
gather_facts: no
5052
any_errors_fatal: true
53+
become: "{{ sudo_or_not | bool }}"
5154
tags:
5255
- prepare
5356
roles:

curve-ansible/deploy_nebd.yml

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
hosts: client
2626
any_errors_fatal: true
2727
gather_facts: no
28+
become: "{{ sudo_or_not | bool }}"
2829
tags:
2930
- prepare_software_env
3031
roles:
@@ -34,6 +35,7 @@
3435
hosts: client
3536
gather_facts: no
3637
any_errors_fatal: true
38+
become: "{{ sudo_or_not | bool }}"
3739
tags:
3840
- prepare
3941
roles:

curve-ansible/roles/generate_config/defaults/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ chunkserver_copyset_election_timeout_ms: 1000
117117
chunkserver_copyset_snapshot_interval_s: 1800
118118
chunkserver_copyset_catchup_margin: 1000
119119
chunkserver_copyset_chunk_data_uri: local://./0/copysets
120-
chunkserver_copyset_raft_log_uri: local://./0/copysets
120+
chunkserver_copyset_raft_log_uri: curve://./0/copysets
121121
chunkserver_copyset_raft_meta_uri: local://./0/copysets
122-
chunkserver_copyset_raft_snapshot_uri: local://./0/copysets
122+
chunkserver_copyset_raft_snapshot_uri: curve://./0/copysets
123123
chunkserver_copyset_recycler_uri: local://./0/recycler
124124
chunkserver_copyset_max_inflight_requests: 5000
125125
chunkserver_copyset_load_concurrency: 10

curve-ansible/roles/install_package/templates/chunkserver_ctl.sh.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function start_one() {
162162
-chunkServerStoreUri=local://${dataDir}/chunkserver$1/ \
163163
-copySetUri=local://${dataDir}/chunkserver$1/copysets \
164164
-raftSnapshotUri=curve://${dataDir}/chunkserver$1/copysets \
165-
-raftLogUri=local://${dataDir}/chunkserver$1/copysets \
165+
-raftLogUri=curve://${dataDir}/chunkserver$1/copysets \
166166
-recycleUri=local://${dataDir}/chunkserver$1/recycler \
167167
-raft_sync_segments=true \
168168
-graceful_quit_on_sigterm=true \

curve-ansible/rolling_update_curve_sdk.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
hosts: client
2626
gather_facts: no
2727
any_errors_fatal: true
28+
become: "{{ sudo_or_not | bool }}"
2829
tags:
2930
- prepare
3031
roles:

curve-ansible/rolling_update_nbd.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
hosts: client
2626
gather_facts: no
2727
any_errors_fatal: true
28+
become: "{{ sudo_or_not | bool }}"
2829
tags:
2930
- prepare
3031
roles:

curve-ansible/rolling_update_nebd.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
hosts: client
2626
gather_facts: no
2727
any_errors_fatal: true
28+
become: "{{ sudo_or_not | bool }}"
2829
tags:
2930
- prepare
3031
roles:

curve-ansible/server.ini

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ retain_pool=False
104104
walfilepool_use_chunk_file_pool=True
105105

106106
[snapshotclone_nginx:vars]
107+
snapshot_nginx_package_version="0.0.6.1.1+7af4d6a4"
107108
snapshotcloneserver_nginx_dir=/etc/curve/nginx
108109
snapshot_nginx_conf_path=/etc/curve/nginx/conf/nginx.conf
109110
snapshot_nginx_lua_conf_path=/etc/curve/nginx/app/etc/config.lua

curve-chunkserver/home/nbs/chunkserver_ctl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function start_one() {
178178
-chunkServerStoreUri=local:///data/chunkserver$1/ \
179179
-copySetUri=local:///data/chunkserver$1/copysets \
180180
-raftSnapshotUri=curve:///data/chunkserver$1/copysets \
181-
-raftLogUri=local:///data/chunkserver$1/copysets \
181+
-raftLogUri=curve:///data/chunkserver$1/copysets \
182182
-recycleUri=local:///data/chunkserver$1/recycler \
183183
-raft_sync_segments=true \
184184
-graceful_quit_on_sigterm=true \

0 commit comments

Comments
 (0)