Remove storage_hostname

This was an attempt to get storage_interface to work properly but that
work will not be completed and functional this cycle. There are design
topics that need to be discussed about it that were brought to light
by the RAX gate failing for it.

TrivialFix

Change-Id: I65579f9e0e0dcf3fa51c0ea031ff474145457c40
This commit is contained in:
SamYaple 2016-03-09 04:12:26 +00:00 committed by Sam Yaple
parent 3b65e49930
commit 7b6fbdf41d
7 changed files with 10 additions and 17 deletions

View File

@ -33,6 +33,7 @@
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
OSD_DEV: "{{ item.1.device }}"
OSD_INITIAL_WEIGHT: "{{ osd_initial_weight }}"
HOSTNAME: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}"
image: "{{ ceph_osd_image_full }}"
labels:
BOOTSTRAP:
@ -55,6 +56,7 @@
CEPH_CACHE:
OSD_DEV: "{{ item.1.device }}"
OSD_INITIAL_WEIGHT: "{{ osd_initial_weight }}"
HOSTNAME: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}"
image: "{{ ceph_osd_image_full }}"
labels:
BOOTSTRAP:

View File

@ -8,7 +8,7 @@
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
MON_IP: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}"
HOSTNAME: "{{ storage_hostname }}"
HOSTNAME: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}"
image: "{{ ceph_mon_image_full }}"
labels:
BOOTSTRAP:

View File

@ -5,7 +5,7 @@
common_options: "{{ docker_common_options }}"
environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
HOSTNAME: "{{ storage_hostname }}"
HOSTNAME: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}"
image: "{{ ceph_mon_image_full }}"
name: "ceph_mon"
volumes:

View File

@ -1,5 +1,5 @@
{
"command": "/usr/bin/ceph-mon -d -i {{ storage_hostname }} --public-addr {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}:6789",
"command": "/usr/bin/ceph-mon -d -i {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }} --public-addr {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}:6789",
"config_files": [
{
"source": "{{ container_config_directory }}/ceph.conf",

View File

@ -1,8 +1,8 @@
[global]
fsid = {{ ceph_cluster_fsid }}
mon initial members = {% for host in groups['ceph-mon'] %}{{ hostvars[host]['storage_hostname'] }}{% if not loop.last %}, {% endif %}{% endfor %}
mon initial members = {% for host in groups['ceph-mon'] %}{{ hostvars[host]['ansible_' + hostvars[host]['storage_interface']]['ipv4']['address'] }}{% if not loop.last %}, {% endif %}{% endfor %}
mon host = {% for host in groups['ceph-mon'] %}{{ hostvars[host]['storage_hostname'] }}{% if not loop.last %}, {% endif %}{% endfor %}
mon host = {% for host in groups['ceph-mon'] %}{{ hostvars[host]['ansible_' + hostvars[host]['storage_interface']]['ipv4']['address'] }}{% if not loop.last %}, {% endif %}{% endfor %}
mon addr = {% for host in groups['ceph-mon'] %}{{ hostvars[host]['ansible_' + hostvars[host]['storage_interface']]['ipv4']['address'] }}:6789{% if not loop.last %}, {% endif %}{% endfor %}

View File

@ -1,13 +1,4 @@
---
- name: Looking up storage hostname
command: getent hosts {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}
changed_when: False
register: storage_hostname
- name: Setting storage hostname
set_fact:
storage_hostname: "{{ storage_hostname.stdout.split()[1] }}"
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item }}"

View File

@ -44,11 +44,11 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
# These commands only need to be run once per host but are safe to run
# repeatedly. This can be improved later or if any problems arise.
ceph osd crush add-bucket "$(hostname)${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}" host
ceph osd crush move "$(hostname)${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}" root=${CEPH_ROOT_NAME:-default}
ceph osd crush add-bucket "${HOSTNAME}${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}" host
ceph osd crush move "${HOSTNAME}${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}" root=${CEPH_ROOT_NAME:-default}
# Adding osd to crush map
ceph osd crush add "${OSD_ID}" "${OSD_INITIAL_WEIGHT}" host="$(hostname)${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}"
ceph osd crush add "${OSD_ID}" "${OSD_INITIAL_WEIGHT}" host="${HOSTNAME}${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}"
exit 0
fi