From d3ceab904d97c0f14aca87865f888add76c89380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Fri, 26 Aug 2016 15:22:47 +0200 Subject: [PATCH] iscsi-gw: preparing the new iscsi role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit adding the bare minimum to test and start the new role. Signed-off-by: Sébastien Han --- Vagrantfile | 32 ++++++++++++++++++++++++++- group_vars/all.sample | 1 + group_vars/iscsi-gws.sample | 10 +++++++++ roles/ceph-common/defaults/main.yml | 1 + roles/ceph-iscsi-gw/defaults/main.yml | 1 + roles/ceph-iscsi-gw/meta/main.yml | 1 + roles/ceph-iscsi-gw/tasks/main.yml | 1 + site.yml.sample | 5 +++++ vagrant_variables.yml.sample | 1 + 9 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 group_vars/iscsi-gws.sample create mode 100644 roles/ceph-iscsi-gw/defaults/main.yml create mode 100644 roles/ceph-iscsi-gw/meta/main.yml create mode 100644 roles/ceph-iscsi-gw/tasks/main.yml diff --git a/Vagrantfile b/Vagrantfile index 0423a9239..eed730a20 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -15,6 +15,7 @@ NNFSS = settings['nfs_vms'] RESTAPI = settings['restapi'] NRBD_MIRRORS = settings['rbd_mirror_vms'] CLIENTS = settings['client_vms'] +NISCSI_GWS = settings['iscsi_gw_vms'] SUBNET = settings['subnet'] BOX = settings['vagrant_box'] BOX_URL = settings['vagrant_box_url'] @@ -55,7 +56,8 @@ ansible_provision = proc do |ansible| 'rgws' => (0..NRGWS - 1).map { |j| "#{OSPREFIX}rgw#{j}" }, 'nfss' => (0..NNFSS - 1).map { |j| "#{OSPREFIX}nfs#{j}" }, 'rbd_mirrors' => (0..NRBD_MIRRORS - 1).map { |j| "#{OSPREFIX}rbd_mirror#{j}" }, - 'clients' => (0..CLIENTS - 1).map { |j| "#{OSPREFIX}client#{j}" } + 'clients' => (0..CLIENTS - 1).map { |j| "#{OSPREFIX}client#{j}" }, + 'iscsi_gw' => (0..NISCSI_GWS - 1).map { |j| "#{OSPREFIX}iscsi_gw#{j}" } } if RESTAPI then @@ -283,6 +285,34 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end end + (0..NISCSI_GWS - 1).each do |i| + config.vm.define "#{OSPREFIX}iscsi_gw#{i}" do |iscsi_gw| + iscsi_gw.vm.hostname = "#{OSPREFIX}ceph-iscsi-gw#{i}" + if !OSVM + iscsi_gw.vm.network :private_network, ip: "#{SUBNET}.9#{i}" + end + # Virtualbox + iscsi_gw.vm.provider :virtualbox do |vb| + vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"] + end + + # VMware + iscsi_gw.vm.provider :vmware_fusion do |v| + v.vmx['memsize'] = "#{MEMORY}" + end + + # Libvirt + iscsi_gw.vm.provider :libvirt do |lv| + lv.memory = MEMORY + end + # Parallels + iscsi_gw.vm.provider "parallels" do |prl| + prl.name = "ceph-iscsi-gw#{i}" + prl.memory = "#{MEMORY}" + end + end + end + (0..NMONS - 1).each do |i| config.vm.define "#{OSPREFIX}mon#{i}" do |mon| mon.vm.hostname = "#{OSPREFIX}ceph-mon#{i}" diff --git a/group_vars/all.sample b/group_vars/all.sample index e0b5919d0..0c56c9ce9 100644 --- a/group_vars/all.sample +++ b/group_vars/all.sample @@ -28,6 +28,7 @@ dummy: #restapi_group_name: restapis #rbdmirror_group_name: rbdmirrors #client_group_name: clients +#iscsi_group_name: iscsigws # If check_firewall is true, then ansible will try to determine if the # Ceph ports are blocked by a firewall. If the machine running ansible diff --git a/group_vars/iscsi-gws.sample b/group_vars/iscsi-gws.sample new file mode 100644 index 000000000..1a03a2047 --- /dev/null +++ b/group_vars/iscsi-gws.sample @@ -0,0 +1,10 @@ +--- +# Variables here are applicable to all host groups NOT roles + +# This sample file generated by generate_group_vars_sample.sh + +# Dummy variable to avoid error because ansible does not recognize the +# file as a good configuration file when no variable in it. +dummy: + + diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 9852ea34e..04f9cc5bd 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -20,6 +20,7 @@ nfs_group_name: nfss restapi_group_name: restapis rbdmirror_group_name: rbdmirrors client_group_name: clients +iscsi_group_name: iscsigws # If check_firewall is true, then ansible will try to determine if the # Ceph ports are blocked by a firewall. If the machine running ansible diff --git a/roles/ceph-iscsi-gw/defaults/main.yml b/roles/ceph-iscsi-gw/defaults/main.yml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/roles/ceph-iscsi-gw/defaults/main.yml @@ -0,0 +1 @@ +--- diff --git a/roles/ceph-iscsi-gw/meta/main.yml b/roles/ceph-iscsi-gw/meta/main.yml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/roles/ceph-iscsi-gw/meta/main.yml @@ -0,0 +1 @@ +--- diff --git a/roles/ceph-iscsi-gw/tasks/main.yml b/roles/ceph-iscsi-gw/tasks/main.yml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/roles/ceph-iscsi-gw/tasks/main.yml @@ -0,0 +1 @@ +--- diff --git a/site.yml.sample b/site.yml.sample index e8ab7bdfa..ebbcb39f8 100644 --- a/site.yml.sample +++ b/site.yml.sample @@ -45,3 +45,8 @@ become: True roles: - ceph-client + +- hosts: iscsigws + become: True + roles: + - ceph-iscsi-gw diff --git a/vagrant_variables.yml.sample b/vagrant_variables.yml.sample index b7fb8a491..c7beab012 100644 --- a/vagrant_variables.yml.sample +++ b/vagrant_variables.yml.sample @@ -11,6 +11,7 @@ rgw_vms: 0 nfs_vms: 0 rbd_mirror_vms: 0 client_vms: 0 +iscsi_gw_vms: 0 # Deploy RESTAPI on each of the Monitors restapi: true