From 860125ff8fa84d390976b9eaa72693d4d455baa6 Mon Sep 17 00:00:00 2001 From: Huamin Chen Date: Thu, 5 Nov 2015 20:39:03 +0000 Subject: [PATCH] various fixes for CentOS Signed-off-by: Huamin Chen --- README.md | 2 +- Vagrantfile | 3 ++- install-ansible.sh | 1 + roles/ceph-common/tasks/main.yml | 8 ++++++++ roles/ceph-osd/tasks/pre_requisite.yml | 8 ++++++++ vagrant_variables.yml.sample | 9 ++++++++- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c08a7bc4f..fc531fff1 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ More details: Run your virtual machines: ```bash -$ vagrant up +$ vagrant up --provider=virtualbox ... ... ... diff --git a/Vagrantfile b/Vagrantfile index 59539d815..6b744c97f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -16,6 +16,7 @@ SUBNET = settings['subnet'] BOX = settings['vagrant_box'] MEMORY = settings['memory'] STORAGECTL = settings['vagrant_storagectl'] +ETH = settings['eth'] ansible_provision = proc do |ansible| ansible.playbook = 'site.yml' @@ -38,7 +39,7 @@ ansible_provision = proc do |ansible| fsid: '4a158d27-f750-41d5-9e7f-26ce4c9d2d45', monitor_secret: 'AQAWqilTCDh7CBAAawXt6kyTgLFCxSvJhTEmuw==', journal_size: 100, - monitor_interface: 'eth1', + monitor_interface: ETH, cluster_network: "#{SUBNET}.0/24", public_network: "#{SUBNET}.0/24", devices: "[ '/dev/sdb', '/dev/sdc' ]", diff --git a/install-ansible.sh b/install-ansible.sh index 1b9fe3755..e9c270515 100644 --- a/install-ansible.sh +++ b/install-ansible.sh @@ -26,5 +26,6 @@ if [[ -x $(which lsb_release 2>/dev/null) ]]; then apt-get install -y ansible fi elif [[ -r /etc/redhat-release ]]; then + yum install -y epel-release yum install -y ansible fi diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index d91721fbb..3eab4498a 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -70,6 +70,14 @@ sudo: false when: fsid != '4a158d27-f750-41d5-9e7f-26ce4c9d2d45' +- name: create ceph conf directory + file: + path: /etc/ceph + state: directory + owner: root + group: root + mode: 0644 + - name: generate ceph configuration file template: src: ceph.conf.j2 diff --git a/roles/ceph-osd/tasks/pre_requisite.yml b/roles/ceph-osd/tasks/pre_requisite.yml index 5db14a273..0a914b430 100644 --- a/roles/ceph-osd/tasks/pre_requisite.yml +++ b/roles/ceph-osd/tasks/pre_requisite.yml @@ -11,6 +11,14 @@ state: present when: ansible_os_family == 'RedHat' +- name: create bootstrap-osd + file: + path: /var/lib/ceph/bootstrap-osd/ + state: directory + owner: root + group: root + mode: 600 + - name: copy osd bootstrap key copy: src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring" diff --git a/vagrant_variables.yml.sample b/vagrant_variables.yml.sample index 18c6c8ab0..09e46791e 100644 --- a/vagrant_variables.yml.sample +++ b/vagrant_variables.yml.sample @@ -11,15 +11,22 @@ client_vms: 0 subnet: 192.168.42 # MEMORY +# set 1024 for CentOS memory: 256 +# Ethernet interface name +# use eth1 for ubuntu, enp0s8 for CentOS +eth: 'eth1' + # VAGRANT BOX # Fedora: https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-22-20150521.x86_64.vagrant-virtualbox.box # Ubuntu: ubuntu/trusty64 -# CentOS: chef/centos-7.0 +# CentOS: bento/centos-7.1 # Debian: deb/jessie-amd64 - be careful the storage controller is named 'SATA Controller' # For more boxes have a look at: # - https://atlas.hashicorp.com/boxes/search?utf8=✓&sort=&provider=virtualbox&q= # - https://download.gluster.org/pub/gluster/purpleidea/vagrant/ vagrant_box: ubuntu/trusty64 + +# use vagrant_storagectl: 'SATA Controller' for CentOS vagrant_storagectl: 'SATAController' -- 2.39.5