update config-external.sh in galera,keystone,rabbitmq,swift

Use variables like SOURCE,TARGET in config-external.sh, so
it will easy to modify in future.

Closes-Bug: #1485710

Change-Id: I3880a2cbca8a80d36e84a797fcfb943e43b88bd5
This commit is contained in:
xiabing.yao 2015-08-06 17:32:56 +08:00
parent 20deecda98
commit b11321cedc
10 changed files with 124 additions and 76 deletions

View File

@ -1,8 +1,11 @@
#!/bin/bash
SOURCE="/opt/kolla/mariadb/galera.cnf"
TARGET="/etc/my.cnf.d/galera.cnf"
OWNER="mysql"
# Cluster configuration
if [[ -f /opt/kolla/mariadb/galera.cnf ]]; then
cp /opt/kolla/mariadb/galera.cnf /etc/my.cnf.d/galera.cnf
chown mysql: /etc/my.cnf.d/galera.cnf
chmod 0600 /etc/my.cnf.d/galera.cnf
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0600 $TARGET
fi

View File

@ -1,13 +1,18 @@
#!/bin/bash
SOURCE="/opt/kolla/keystone/keystone.conf"
TARGET="/etc/keystone/keystone.conf"
SOURCE_WSGI="/opt/kolla/keystone/wsgi-keystone.conf"
TARGET_WSGI="/etc/httpd/conf.d/wsgi-keystone.conf"
OWNER="keystone"
if [[ -f /opt/kolla/keystone/wsgi-keystone.conf ]]; then
cp /opt/kolla/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
chown root:keystone /etc/httpd/conf.d/wsgi-keystone.conf
chmod 0644 /etc/httpd/conf.d/wsgi-keystone.conf
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi
if [[ -f /opt/kolla/keystone/keystone.conf ]]; then
cp /opt/kolla/keystone/keystone.conf /etc/keystone/keystone.conf
chown keystone: /etc/keystone/keystone.conf
chmod 0644 /etc/keystone/keystone.conf
if [[ -f "$SOURCE_WSGI" ]]; then
cp $SOURCE_WSGI $TARGET_WSGI
chown ${OWNER}: $TARGET_WSGI
chmod 0644 $TARGET_WSGI
fi

View File

@ -1,14 +1,19 @@
#!/bin/bash
SOURCE_CONFIG="/opt/kolla/rabbitmq/rabbitmq.config"
TARGET_CONFIG="/etc/rabbitmq/rabbitmq.config"
SOURCE_ENV="/opt/kolla/rabbitmq/rabbitmq-env.conf"
TARGET_ENV="/etc/rabbitmq/rabbitmq-env.conf"
OWNER="rabbitmq"
# Cluster configuration
if [[ -f /opt/kolla/rabbitmq/rabbitmq.config ]]; then
cp -af /opt/kolla/rabbitmq/rabbitmq.config /etc/rabbitmq/rabbitmq.config
chown rabbitmq: /etc/rabbitmq/rabbitmq.config
chmod 0600 /etc/rabbitmq/rabbitmq.config
if [[ -f "$SOURCE_CONFIG" ]]; then
cp -af $SOURCE_CONFIG $TARGET_CONFIG
chown ${OWNER}: $TARGET_CONFIG
chmod 0600 $TARGET_CONFIG
fi
if [[ -f /opt/kolla/rabbitmq/rabbitmq-env.conf ]]; then
cp -af /opt/kolla/rabbitmq/rabbitmq-env.conf /etc/rabbitmq/rabbitmq-env.conf
chown rabbitmq: /etc/rabbitmq/rabbitmq-env.conf
chmod 0600 /etc/rabbitmq/rabbitmq-env.conf
if [[ -f "$SOURCE_ENV" ]]; then
cp -af $SOURCE_ENV $TARGET_ENV
chown ${OWNER}: $TARGET_ENV
chmod 0600 $TARGET_ENV
fi

View File

@ -1,13 +1,18 @@
#!/bin/bash
SOURCE="/opt/kolla/swift/swift.conf"
TARGET="/etc/swift/swift.conf"
SOURCE_ACCOUNT_SERVER="/opt/kolla/swift/account-server.conf"
TARGET_ACCOUNT_SERVER="/etc/swift/account-server.conf"
OWNER="swift"
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /etc/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0640 $TARGET
fi
if [[ -f /opt/kolla/swift/account-server.conf ]]; then
cp /opt/kolla/swift/account-server.conf /etc/swift/
chown swift: /etc/swift/account-server.conf
chmod 0640 /etc/swift/account-server.conf
if [[ -f "$SOURCE_ACCOUNT_SERVER" ]]; then
cp $SOURCE_ACCOUNT_SERVER $TARGET_ACCOUNT_SERVER
chown ${OWNER}: $TARGET_ACCOUNT_SERVER
chmod 0640 $TARGET_ACCOUNT_SERVER
fi

View File

@ -1,13 +1,18 @@
#!/bin/bash
SOURCE="/opt/kolla/swift/swift.conf"
TARGET="/etc/swift/swift.conf"
SOURCE_CONTAINER_SERVER="/opt/kolla/swift/container-server.conf"
TARGET_CONTAINER_SERVER="/etc/swift/container-server.conf"
OWNER="swift"
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /etc/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0640 $TARGET
fi
if [[ -f /opt/kolla/swift/container-server.conf ]]; then
cp /opt/kolla/swift/container-server.conf /etc/swift/
chown swift: /etc/swift/container-server.conf
chmod 0640 /etc/swift/container-server.conf
if [[ -f "$SOURCE_CONTAINER_SERVER" ]]; then
cp $SOURCE_CONTAINER_SERVER $TARGET_CONTAINER_SERVER
chown ${OWNER}: $TARGET_CONTAINER_SERVER
chmod 0640 $TARGET_CONTAINER_SERVER
fi

View File

@ -1,13 +1,18 @@
#!/bin/bash
SOURCE="/opt/kolla/swift/swift.conf"
TARGET="/etc/swift/swift.conf"
SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf"
TARGET_OBJECT_SERVER="/etc/swift/object-server.conf"
OWNER="swift"
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /etc/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0640 $TARGET
fi
if [[ -f /opt/kolla/swift/object-server.conf ]]; then
cp /opt/kolla/swift/object-server.conf /etc/swift/
chown swift: /opt/kolla/swift/object-server.conf
chmod 0640 /etc/swift/object-server.conf
if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then
cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER
chown ${OWNER}: $TARGET_OBJECT_SERVER
chmod 0640 $TARGET_OBJECT_SERVER
fi

View File

@ -1,13 +1,18 @@
#!/bin/bash
SOURCE="/opt/kolla/swift/swift.conf"
TARGET="/etc/swift/swift.conf"
SOURCE_OBJECT_EXPIRER="/opt/kolla/swift/object-expirer.conf"
TARGET_OBJECT_EXPIRER="/etc/swift/object-expirer.conf"
OWNER="swift"
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /opt/kolla/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0640 $TARGET
fi
if [[ -f /opt/kolla/swift/object-expirer.conf ]]; then
cp /opt/kolla/swift/object-expirer.conf /etc/swift/
chown swift: /opt/kolla/swift/object-expirer.conf
chmod 0640 /etc/swift/object-expirer.conf
if [[ -f "$SOURCE_OBJECT_EXPIRER" ]]; then
cp $SOURCE_OBJECT_EXPIRER $TARGET_OBJECT_EXPIRER
chown ${OWNER}: $TARGET_OBJECT_EXPIRER
chmod 0640 $TARGET_OBJECT_EXPIRER
fi

View File

@ -1,13 +1,18 @@
#!/bin/bash
SOURCE="/opt/kolla/swift/swift.conf"
TARGET="/etc/swift/swift.conf"
SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf"
TARGET_OBJECT_SERVER="/etc/swift/object-server.conf"
OWNER="swift"
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /opt/kolla/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0640 $TARGET
fi
if [[ -f /opt/kolla/swift/object-server.conf ]]; then
cp /opt/kolla/swift/object-server.conf /etc/swift/
chown swift: /opt/kolla/swift/object-server.conf
chmod 0640 /etc/swift/object-server.conf
if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then
cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER
chown ${OWNER}: $TARGET_OBJECT_SERVER
chmod 0640 $TARGET_OBJECT_SERVER
fi

View File

@ -1,13 +1,18 @@
#!/bin/bash
SOURCE="/opt/kolla/swift/swift.conf"
TARGET="/etc/swift/swift.conf"
SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf"
TARGET_OBJECT_SERVER="/etc/swift/object-server.conf"
OWNER="swift"
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /opt/kolla/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0640 $TARGET
fi
if [[ -f /opt/kolla/swift/object-server.conf ]]; then
cp /opt/kolla/swift/object-server.conf /etc/swift/
chown swift: /opt/kolla/swift/object-server.conf
chmod 0640 /etc/swift/object-server.conf
if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then
cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER
chown ${OWNER}: $TARGET_OBJECT_SERVER
chmod 0640 $TARGET_OBJECT_SERVER
fi

View File

@ -1,13 +1,18 @@
#!/bin/bash
SOURCE="/opt/kolla/swift/swift.conf"
TARGET="/etc/swift/swift.conf"
SOURCE_OBJECT_SERVER="/opt/kolla/swift/object-server.conf"
TARGET_OBJECT_SERVER="/etc/swift/object-server.conf"
OWNER="swift"
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /etc/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0640 $TARGET
fi
if [[ -f /opt/kolla/swift/object-server.conf ]]; then
cp /opt/kolla/swift/object-server.conf /etc/swift/
chown swift: /etc/swift/object-server.conf
chmod 0640 /etc/swift/object-server.conf
if [[ -f "$SOURCE_OBJECT_SERVER" ]]; then
cp $SOURCE_OBJECT_SERVER $TARGET_OBJECT_SERVER
chown ${OWNER}: $TARGET_OBJECT_SERVER
chmod 0640 $TARGET_OBJECT_SERVER
fi