From 8d29f367df9cc814870519a5eabe874efa2bf62e Mon Sep 17 00:00:00 2001 From: sean Date: Thu, 22 Jul 2021 17:15:07 +0800 Subject: [PATCH] ansible: fix mds etcd daemon script --- .../tasks/include/install_etcd-daemon.yml | 19 +++++++++++++++++++ .../templates/etcd-daemon.sh.j2 | 2 +- .../templates/mds-daemon.sh.j2 | 2 +- curve-ansible/rolling_update_curve.yml | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 curve-ansible/roles/install_package/tasks/include/install_etcd-daemon.yml diff --git a/curve-ansible/roles/install_package/tasks/include/install_etcd-daemon.yml b/curve-ansible/roles/install_package/tasks/include/install_etcd-daemon.yml new file mode 100644 index 0000000000..ea67b13a9d --- /dev/null +++ b/curve-ansible/roles/install_package/tasks/include/install_etcd-daemon.yml @@ -0,0 +1,19 @@ +--- +# +# Copyright (c) 2021 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. +# + +- name: generate etcd-daemon.sh + template: src=etcd-daemon.sh.j2 dest={{ deploy_dir }}/etcd-daemon.sh mode=0755 diff --git a/curve-ansible/roles/install_package/templates/etcd-daemon.sh.j2 b/curve-ansible/roles/install_package/templates/etcd-daemon.sh.j2 index 00dacd979f..6c0b36c932 100644 --- a/curve-ansible/roles/install_package/templates/etcd-daemon.sh.j2 +++ b/curve-ansible/roles/install_package/templates/etcd-daemon.sh.j2 @@ -10,7 +10,7 @@ logDir={{ etcd_log_dir }} logPath=${logDir}/etcd.log # pidfile -pidFile={{ deploy_dir }}/etcd.pid +pidFile=${HOME}/etcd.pid # daemon log daemonLog=${logDir}/daemon-etcd.log diff --git a/curve-ansible/roles/install_package/templates/mds-daemon.sh.j2 b/curve-ansible/roles/install_package/templates/mds-daemon.sh.j2 index b1e2112cd0..3ea33bdd8a 100644 --- a/curve-ansible/roles/install_package/templates/mds-daemon.sh.j2 +++ b/curve-ansible/roles/install_package/templates/mds-daemon.sh.j2 @@ -13,7 +13,7 @@ logPath={{ mds_log_dir }} mdsAddr= # pidfile -pidFile={{ deploy_dir }}/curve-mds.pid +pidFile=${HOME}/curve-mds.pid # daemon log daemonLog=${logPath}/curve-mds-daemon.log diff --git a/curve-ansible/rolling_update_curve.yml b/curve-ansible/rolling_update_curve.yml index 2452b6384c..fddd6832bf 100644 --- a/curve-ansible/rolling_update_curve.yml +++ b/curve-ansible/rolling_update_curve.yml @@ -33,6 +33,7 @@ roles: - { role: install_package, package_name: etcd, tags: install_etcd } - { role: generate_config, template_name: etcd.conf.yml, conf_path: "{{ etcd_config_path }}", tags: update_etcd_config } + - { role: install_package, package_name: etcd-daemon, tags: install_etcd_daemon } - name: set etcd leader and follower list hosts: etcd