Skip to content
Snippets Groups Projects
Commit e69571ee authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Convert ceph to json"

parents 6c1e4e02 83d19524
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
- "{{ node_templates_directory }}/{{ service_name }}/ceph.conf_augment" - "{{ node_templates_directory }}/{{ service_name }}/ceph.conf_augment"
config_dest: "{{ node_config_directory }}/{{ service_name }}/ceph.conf" config_dest: "{{ node_config_directory }}/{{ service_name }}/ceph.conf"
- name: Copying over ceph-mon JSON configuration file
template:
src: "ceph-mon.json.j2"
dest: "{{ node_config_directory }}/ceph-mon/config.json"
- include: ../../config.yml - include: ../../config.yml
vars: vars:
service_name: "ceph-osd" service_name: "ceph-osd"
...@@ -20,3 +25,8 @@ ...@@ -20,3 +25,8 @@
- "{{ node_templates_directory }}/{{ service_name }}/ceph.conf_minimal" - "{{ node_templates_directory }}/{{ service_name }}/ceph.conf_minimal"
- "{{ node_templates_directory }}/{{ service_name }}/ceph.conf_augment" - "{{ node_templates_directory }}/{{ service_name }}/ceph.conf_augment"
config_dest: "{{ node_config_directory }}/{{ service_name }}/ceph.conf" config_dest: "{{ node_config_directory }}/{{ service_name }}/ceph.conf"
- name: Copying over ceph-osd JSON configuration file
template:
src: "ceph-osd.json.j2"
dest: "{{ node_config_directory }}/ceph-osd/config.json"
...@@ -18,5 +18,4 @@ ...@@ -18,5 +18,4 @@
- "ceph_mon_data" - "ceph_mon_data"
env: env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
MON_IP: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
when: inventory_hostname in groups['ceph-mon'] when: inventory_hostname in groups['ceph-mon']
{
"command": "/usr/bin/ceph-mon -d -i {{ ansible_hostname }} --public-addr {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}:6789",
"config_files": [
{
"source": "/opt/kolla/config_files/ceph.conf",
"dest": "/etc/ceph/ceph.conf",
"owner": "glance",
"perm": "0600"
}
{
"source": "/opt/kolla/config_files/ceph.client.admin.keyring",
"dest": "/etc/ceph/ceph.client.admin.keyring",
"owner": "ceph",
"perm": "0600"
"optional": True
},
{
"source": "/opt/kolla/config_files/ceph.client.mon.keyring",
"dest": "/etc/ceph/ceph.client.mon.keyring",
"owner": "ceph",
"perm": "0600"
"optional": True
},
{
"source": "/opt/kolla/config_files/ceph.monmap",
"dest": "/etc/ceph/ceph.monmap",
"owner": "ceph",
"perm": "0600"
"optional": True
}
]
}
{
"command": "/usr/bin/ceph-osd -f -d",
"config_files": [
{
"source": "/opt/kolla/config_files/ceph.conf",
"dest": "/etc/ceph/ceph.conf",
"owner": "glance",
"perm": "0600"
},
{
"source": "/opt/kolla/config_files/ceph.client.admin.keyring",
"dest": "/etc/ceph/ceph.client.admin.keyring",
"owner": "ceph",
"perm": "0600"
}
]
}
#!/bin/bash
SOURCE="/opt/kolla/ceph-mon/ceph.conf"
TARGET="/etc/ceph/ceph.conf"
OWNER="ceph"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi
SOURCE="/opt/kolla/ceph-mon/ceph.client.admin.keyring"
TARGET="/etc/ceph/ceph.client.admin.keyring"
OWNER="ceph"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0600 $TARGET
fi
SOURCE="/opt/kolla/ceph-mon/ceph.client.mon.keyring"
TARGET="/etc/ceph/ceph.client.mon.keyring"
OWNER="ceph"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0600 $TARGET
fi
SOURCE="/opt/kolla/ceph-mon/ceph.monmap"
TARGET="/etc/ceph/ceph.monmap"
OWNER="ceph"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0600 $TARGET
fi
#!/bin/bash #!/bin/bash
set -o errexit set -o errexit
CMD="/usr/bin/ceph-mon"
ARGS="-d -i $(hostname) --public-addr ${MON_IP}:6789"
# Setup common paths # Setup common paths
KEYRING_ADMIN="/etc/ceph/ceph.client.admin.keyring" KEYRING_ADMIN="/etc/ceph/ceph.client.admin.keyring"
KEYRING_MON="/etc/ceph/ceph.client.mon.keyring" KEYRING_MON="/etc/ceph/ceph.client.mon.keyring"
...@@ -41,4 +38,4 @@ if [[ ! -e "${MON_DIR}/keyring" ]]; then ...@@ -41,4 +38,4 @@ if [[ ! -e "${MON_DIR}/keyring" ]]; then
rm "${KEYRING_TMP}" rm "${KEYRING_TMP}"
fi fi
exec $CMD $ARGS exec $CMD
#!/bin/bash
SOURCE="/opt/kolla/ceph-osd/ceph.conf"
TARGET="/etc/ceph/ceph.conf"
OWNER="ceph"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi
SOURCE="/opt/kolla/ceph-osd/ceph.client.admin.keyring"
TARGET="/etc/ceph/ceph.client.admin.keyring"
OWNER="ceph"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0600 $TARGET
fi
...@@ -7,11 +7,9 @@ source /opt/kolla/kolla-common.sh ...@@ -7,11 +7,9 @@ source /opt/kolla/kolla-common.sh
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases # Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty. # of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
JOURNAL_PARTUUID=$(uuidgen)
# Formating disk for ceph # Formating disk for ceph
sgdisk --zap-all -- "${OSD_DEV}" sgdisk --zap-all -- "${OSD_DEV}"
sgdisk --new=2:1M:5G --change-name=2:KOLLA_CEPH_JOURNAL --typecode=2:45B0969E-9B03-4F30-B4C6-B4B80CEFF106 --partition-guid=2:${JOURNAL_PARTUUID} --mbrtogpt -- "${OSD_DEV}" sgdisk --new=2:1M:5G --change-name=2:KOLLA_CEPH_JOURNAL --typecode=2:45B0969E-9B03-4F30-B4C6-B4B80CEFF106 --mbrtogpt -- "${OSD_DEV}"
sgdisk --largest-new=1 --change-name=1:KOLLA_CEPH_DATA --typecode=1:4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D -- "${OSD_DEV}" sgdisk --largest-new=1 --change-name=1:KOLLA_CEPH_DATA --typecode=1:4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D -- "${OSD_DEV}"
# This command may throw errors that we can safely ignore # This command may throw errors that we can safely ignore
partprobe || true partprobe || true
...@@ -45,7 +43,6 @@ fi ...@@ -45,7 +43,6 @@ fi
# We look up the appropriate journal since we cannot rely on symlinks # We look up the appropriate journal since we cannot rely on symlinks
JOURNAL_PARTITION=$(ls "${OSD_DEV}"* | egrep "${OSD_DEV}p?2") JOURNAL_PARTITION=$(ls "${OSD_DEV}"* | egrep "${OSD_DEV}p?2")
OSD_DIR="/var/lib/ceph/osd/ceph-${OSD_ID}" OSD_DIR="/var/lib/ceph/osd/ceph-${OSD_ID}"
CMD="/usr/bin/ceph-osd" ARGS="-i ${OSD_ID} --osd-journal ${JOURNAL_PARTITION} -k ${OSD_DIR}/keyring"
ARGS="-f -d -i ${OSD_ID} --osd-journal ${JOURNAL_PARTITION} -k ${OSD_DIR}/keyring"
exec $CMD $ARGS exec $CMD $ARGS
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment