Ansible playbooks for deploying OpenStack.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Vagrantfile 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Licensed under the Apache License, Version 2.0 (the "License");
  2. # you may not use this file except in compliance with the License.
  3. # You may obtain a copy of the License at
  4. #
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. #
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS,
  9. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. # See the License for the specific language governing permissions and
  11. # limitations under the License.
  12. # Verify whether required plugins are installed.
  13. required_plugins = [ "vagrant-disksize" ]
  14. required_plugins.each do |plugin|
  15. if not Vagrant.has_plugin?(plugin)
  16. raise "The vagrant plugin #{plugin} is required. Please run `vagrant plugin install #{plugin}`"
  17. end
  18. end
  19. Vagrant.configure(2) do |config|
  20. # Configure all VM specs.
  21. config.vm.provider "virtualbox" do |v|
  22. v.memory = 12288
  23. v.cpus = 4
  24. end
  25. config.vm.synced_folder ".", "/vagrant", type: "rsync"
  26. # Configure the disk size.
  27. disk_size = "60GB"
  28. config.vm.define "ubuntu1804" do |bionic|
  29. bionic.vm.box = "ubuntu/bionic64"
  30. bionic.disksize.size = disk_size
  31. config.vm.provision "shell",
  32. privileged: true,
  33. inline: <<-SHELL
  34. cd /vagrant
  35. ./scripts/gate-check-commit.sh
  36. SHELL
  37. end
  38. config.vm.define "centos7" do |centos7|
  39. centos7.vm.box = "centos/7"
  40. centos7.disksize.size = disk_size
  41. # The CentOS build does not have growroot, so we
  42. # have to do it ourselves.
  43. config.vm.provision "shell",
  44. privileged: true,
  45. inline: <<-SHELL
  46. cd /vagrant
  47. PART_START=$(parted /dev/sda --script unit MB print | awk '/^ 3 / {print $3}')
  48. parted /dev/sda --script unit MB mkpart primary ${PART_START} 100%
  49. parted /dev/sda --script set 4 lvm on
  50. pvcreate /dev/sda4
  51. vgextend VolGroup00 /dev/sda4
  52. lvextend -l +100%FREE /dev/mapper/VolGroup00-LogVol00
  53. xfs_growfs /dev/mapper/VolGroup00-LogVol00
  54. ./scripts/gate-check-commit.sh
  55. SHELL
  56. end
  57. config.vm.define "opensuse423" do |leap423|
  58. leap423.disksize.size = disk_size
  59. leap423.vm.box = "opensuse/openSUSE-42.3-x86_64"
  60. leap423.vm.provision "shell",
  61. # NOTE(hwoarang) The parted version in Leap 42.3 can't do an online
  62. # partition resize so we must create a new one and attach it to the
  63. # btrfs filesystem.
  64. privileged: true,
  65. inline: <<-SHELL
  66. cd /vagrant
  67. echo -e 'd\n2\nn\np\n\n\n\nn\nw' | fdisk /dev/sda
  68. PART_END=$(fdisk -l /dev/sda | grep ^/dev/sda2 | awk '{print $4}')
  69. resizepart /dev/sda 2 $PART_END
  70. btrfs fi resize max /
  71. ./scripts/gate-check-commit.sh
  72. SHELL
  73. end
  74. config.vm.define "opensuse150" do |leap150|
  75. leap150.disksize.size = disk_size
  76. leap150.vm.box = "opensuse/openSUSE-15.0-x86_64"
  77. leap150.vm.provision "shell",
  78. privileged: true,
  79. inline: <<-SHELL
  80. cd /vagrant
  81. zypper -qn in gdisk
  82. echo -e 'x\ne\nw\ny\n' | gdisk /dev/sda
  83. parted -s /dev/sda unit GB resizepart 3 100%
  84. btrfs fi resize max /
  85. ./scripts/gate-check-commit.sh
  86. SHELL
  87. end
  88. end