From aa65c33150d0a2b1673d019d678c1b65ac98f99e Mon Sep 17 00:00:00 2001 From: Alan Birtles Date: Tue, 15 Aug 2017 14:23:29 +0100 Subject: [PATCH] set hostname using ansible rather than vagrant setting hostname with vagrant seems to fail due to something related to https://github.com/mitchellh/vagrant/issues/2745 --- Vagrantfile | 2 -- roles/common/tasks/main.yml | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 70109e1..7b2e46a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -36,7 +36,6 @@ config.ssh.insert_key = false # workaround for https://github.com/mitchellh/vagr (0..MONITORNO - 1).each do |i| config.vm.define "mon#{i}" do |mon| - mon.vm.hostname = "mon#{i}" mon.vm.network :private_network, ip: "#{SUBNET}.1#{i}" mon.vm.provider :virtualbox do |vb| vb.customize ['modifyvm', :id, '--memory', '192'] @@ -49,7 +48,6 @@ config.ssh.insert_key = false # workaround for https://github.com/mitchellh/vagr (0..OSDNO - 1).each do |i| config.vm.define "osd#{i}" do |osd| - osd.vm.hostname = "osd#{i}" osd.vm.network :private_network, ip: "#{SUBNET}.10#{i}" osd.vm.network :private_network, ip: "#{SUBNET}.20#{i}" osd.vm.provider :virtualbox do |vb| diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 7e9a1d0..a36cac0 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -3,6 +3,13 @@ # +- name: "set hostname" + hostname: + name: "{{ inventory_hostname }}" + +- name: "set git config http" + command: git config --global url."https://".insteadOf git:// + - name: Copying Ceph key template: src=roles/common/templates/ceph-key dest=/tmp/ceph-key owner=root group=root mode=0644 ignore_errors: True