Skip to content

Commit

Permalink
Merge pull request #13 from cloudops/4.11_and_cookstyle
Browse files Browse the repository at this point in the history
4.11 and cookstyle, cookbook version 5.0.0
  • Loading branch information
pdion891 committed Sep 15, 2018
2 parents 44a3253 + efda66b commit b6916e5
Show file tree
Hide file tree
Showing 43 changed files with 401 additions and 420 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
AllCops:
Exclude:
- 'Vagrantfile'
2 changes: 1 addition & 1 deletion Berksfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://supermarket.chef.io"
source 'https://supermarket.chef.io'

metadata
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ cloudstack CHANGELOG

This file is used to list changes made in each version of the co-cloudstack cookbook.

4.1.3
-----
- pdion891 - update default version to 4.11.

4.1.2
-----
- khos2ow - add default metadata expire to cloudstack repo
Expand Down
12 changes: 6 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ gem 'berkshelf'
# Uncomment these lines if you want to live on the Edge:
#
# group :development do
# gem "berkshelf", github: "berkshelf/berkshelf"
# gem "vagrant", github: "mitchellh/vagrant", tag: "v1.6.3"
# gem 'berkshelf', github: 'berkshelf/berkshelf'
# gem 'vagrant', github: 'mitchellh/vagrant', tag: 'v1.6.3'
# end
#
# group :plugins do
# gem "vagrant-berkshelf", github: "berkshelf/vagrant-berkshelf"
# gem "vagrant-omnibus", github: "schisamo/vagrant-omnibus"
# gem 'vagrant-berkshelf', github: 'berkshelf/vagrant-berkshelf'
# gem 'vagrant-omnibus', github: 'schisamo/vagrant-omnibus'
# end

gem "test-kitchen"
gem "kitchen-vagrant"
gem 'test-kitchen'
gem 'kitchen-vagrant'
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2018 CloudOps Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ cloudstack Cookbook
Install and configure [Apache Cloudstack](http://cloudstack.apache.org) using [Chef](http://www.chef.io/). A wrapper cookbook is prefered in order to Install Apache CloudStack properly, refer to [cloudstack_wrapper cookbook](https://github.com/cloudops/cookbook_cloudstack_wrapper) for example.


Tested on CentOS 6.5 and Ubuntu 14.04
Work with Chef 12 only.

Tested on CentOS 7 and Ubuntu 16.04


About Apache Cloudstack
Expand Down Expand Up @@ -204,7 +206,8 @@ e.g.

License and Authors
-------------------
- Author:: Pierre-Luc Dion (<pdion@cloudops.com>)
- Author:: Pierre-Luc Dion (<pdion@cloud.ca>)
- Author:: Khosrow Moossavi (kmoossavi@cloud.ca)

Some snippets have been taken from: [schubergphilis/cloudstack-cookbook](https://github.com/schubergphilis/cloudstack-cookbook)
- Author:: Roeland Kuipers (<rkuipers@schubergphilis.com>)
Expand All @@ -213,7 +216,7 @@ Some snippets have been taken from: [schubergphilis/cloudstack-cookbook](https:/


```text
Copyright:: Copyright (c) 2015 Author's
Copyright:: Copyright (c) 2018 CloudOps Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions Thorfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ require 'bundler/setup'
require 'berkshelf/thor'

begin
require "kitchen/thor_tasks"
require 'kitchen/thor_tasks'
Kitchen::ThorTasks.new
rescue LoadError
puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV["CI"]
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
end
9 changes: 4 additions & 5 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#
# $ vagrant plugin install vagrant-omnibus
#
if Vagrant.has_plugin?("vagrant-omnibus")
if Vagrant.has_plugin?('vagrant-omnibus')
config.omnibus.chef_version = 'latest'
end

Expand All @@ -27,7 +27,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# config.vm.box_url doesn't need to be specified.
config.vm.box = 'chef/ubuntu-14.04'


# Assign this VM to a host-only network IP, allowing you to access it
# via the IP. Host-only networks can talk to the host machine as well as
# any other machines on the same network, but cannot be accessed (through this
Expand Down Expand Up @@ -79,12 +78,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
mysql: {
server_root_password: 'rootpass',
server_debian_password: 'debpass',
server_repl_password: 'replpass'
}
server_repl_password: 'replpass',
},
}

chef.run_list = [
'recipe[cloudstack::default]'
'recipe[cloudstack::default]',
]
end
end
25 changes: 12 additions & 13 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Cookbook Name:: cloudstack
# Attribute:: default
# Author:: Pierre-Luc Dion (<pdion@cloudops.com>)
# Copyright 2015, CloudOps, Inc.
# Copyright 2018, CloudOps, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,31 +20,30 @@
# Apache repos:
###############
# version = version of package to install if not define = latest from the repo
default['cloudstack']['version'] = ""
default['cloudstack']['version'] = ''
# relase_major = release version, used for the repo URL
if node['cloudstack']['version'].empty?
default['cloudstack']['release_major'] = "4.9"
else
default['cloudstack']['release_major'] = "#{node['cloudstack']['version'].split('.')[0]}.#{node['cloudstack']['version'].split('.')[1]}"
end
default['cloudstack']['release_major'] = if node['cloudstack']['version'].empty?
'4.11'
else
"#{node['cloudstack']['version'].split('.')[0]}.#{node['cloudstack']['version'].split('.')[1]}"
end

# yum repo URL
case node['platform']
when 'centos', 'redhat', 'fedora', 'oracle'
default['cloudstack']['repo_url'] = "http://cloudstack.apt-get.eu/centos/$releasever/#{node['cloudstack']['release_major']}/"
default['cloudstack']['repo_sign'] = ''
#default['cloudstack']['repo_sign'] = 'http://cloudstack.apt-get.eu/RPM-GPG-KEY'
# default['cloudstack']['repo_sign'] = 'http://cloudstack.apt-get.eu/RPM-GPG-KEY'
default['cloudstack']['repo_enabled'] = true
default['cloudstack']['repo_metadata_expire'] = '6h'
when 'ubuntu', 'debian'
default['cloudstack']['repo_url'] = "http://cloudstack.apt-get.eu/ubuntu"
default['cloudstack']['repo_url'] = 'http://cloudstack.apt-get.eu/ubuntu'
default['cloudstack']['repo_sign'] = 'http://cloudstack.apt-get.eu/release.asc'
default['cloudstack']['repo_trust'] = true # trust the community repo
default['cloudstack']['repo_trust'] = true # trust the community repo
end
# apt repo URL


# Secondary Storage
default['cloudstack']['secondary']['host'] = node["ipaddress"]
default['cloudstack']['secondary']['path'] = "/data/secondary"
default['cloudstack']['secondary']['host'] = node['ipaddress']
default['cloudstack']['secondary']['path'] = '/data/secondary'
default['cloudstack']['secondary']['mgt_path'] = node['cloudstack']['secondary']['path']
4 changes: 2 additions & 2 deletions attributes/eventbus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Cookbook Name:: cloudstack
# Attribute:: eventbus
# Author:: Pierre-Luc Dion (<pdion@cloudops.com>)
# Copyright 2015, CloudOps, Inc.
# Copyright 2018, CloudOps, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,4 +21,4 @@
default['cloudstack']['event']['RabbitMQEventBus']['port'] = '5672'
default['cloudstack']['event']['RabbitMQEventBus']['username'] = 'guest'
default['cloudstack']['event']['RabbitMQEventBus']['password'] = 'guest'
default['cloudstack']['event']['RabbitMQEventBus']['exchange'] = 'cloudstack-events'
default['cloudstack']['event']['RabbitMQEventBus']['exchange'] = 'cloudstack-events'
2 changes: 1 addition & 1 deletion attributes/management_server.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cookbook Name:: cloudstack
# Attribute:: management_server
# Author:: Pierre-Luc Dion (<pdion@cloudops.com>)
# Copyright 2015, CloudOps, Inc.
# Copyright 2018, CloudOps, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions attributes/mysql_conf.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cookbook Name:: cloudstack
# Recipe:: mysql_conf
# Author:: Pierre-Luc Dion (<pdion@cloudops.com>)
# Copyright 2015, CloudOps, Inc.
# Copyright 2018, CloudOps, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -19,4 +19,4 @@

default['cloudstack']['mysql']['innodb_rollback_on_timeout'] = 1
default['cloudstack']['mysql']['innodb_lock_wait_timeout'] = 600
default['cloudstack']['mysql']['max_connections'] = 350
default['cloudstack']['mysql']['max_connections'] = 350
89 changes: 49 additions & 40 deletions attributes/systemvm_template.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cookbook Name:: cloudstack
# Attribute:: systemvm_template
# Author:: Pierre-Luc Dion (<pdion@cloudops.com>)
# Copyright 2015, CloudOps, Inc.
# Copyright 2018, CloudOps, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,51 +16,60 @@
# limitations under the License.
#


# System VM templates
default['cloudstack']['cloud-install-sys-tmplt'] = '/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt'

case node['cloudstack']['release_major']
# when ? : if system VM template not define cloudstack_system_template will look
# for the URL define into cloudstack database.

when '4.11'
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-xen.vhd.bz2',
'vmware' => 'http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-vmware.ova',
'kvm' => 'http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-kvm.qcow2.bz2',
'lxc' => 'http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-kvm.qcow2.bz2',
'hyperv' => 'http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-hyperv.vhd.zip',
'ovm3' => 'http://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.1-ovm.raw.bz2',
}
when '4.6', '4.7', '4.8', '4.9'
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-xen.vhd.bz2',
'vmware' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-vmware.ova',
'kvm' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-kvm.qcow2.bz2',
'lxc' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-kvm.qcow2.bz2',
'hyperv' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-hyperv.vhd.zip',
'ovm3' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-ovm.raw.bz2'
}
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-xen.vhd.bz2',
'vmware' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-vmware.ova',
'kvm' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-kvm.qcow2.bz2',
'lxc' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-kvm.qcow2.bz2',
'hyperv' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-hyperv.vhd.zip',
'ovm3' => 'http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-ovm.raw.bz2',
}
when '4.5'
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-xen.vhd.bz2',
'vmware' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-vmware.ova',
'kvm' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-kvm.qcow2.bz2',
'lxc' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-kvm.qcow2.bz2',
'hyperv' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-hyperv.vhd.zip'
}
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-xen.vhd.bz2',
'vmware' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-vmware.ova',
'kvm' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-kvm.qcow2.bz2',
'lxc' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-kvm.qcow2.bz2',
'hyperv' => 'http://cloudstack.apt-get.eu/systemvm/4.5/systemvm64template-4.5-hyperv.vhd.zip',
}
when '4.4'
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-xen.vhd.bz2',
'vmware' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-vmware.ova',
'kvm' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-kvm.qcow2.bz2',
'lxc' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-kvm.qcow2.bz2',
'hyperv' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-hyperv.vhd'
}
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-xen.vhd.bz2',
'vmware' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-vmware.ova',
'kvm' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-kvm.qcow2.bz2',
'lxc' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-kvm.qcow2.bz2',
'hyperv' => 'http://cloudstack.apt-get.eu/systemvm/4.4/systemvm64template-4.4.1-7-hyperv.vhd',
}
when '4.3'
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-xen.vhd.bz2',
'vmware' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-vmware.ova',
'kvm' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-kvm.qcow2.bz2',
'lxc' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-kvm.qcow2.bz2',
'hyperv' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-hyperv.vhd.bz2'
}
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-xen.vhd.bz2',
'vmware' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-vmware.ova',
'kvm' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-kvm.qcow2.bz2',
'lxc' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-kvm.qcow2.bz2',
'hyperv' => 'http://download.cloud.com/templates/4.3/systemvm64template-2014-06-23-master-hyperv.vhd.bz2',
}
when '4.2'
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-2013-07-12-master-xen.vhd.bz2',
'vmware' => 'http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-4.2-vh7.ova',
'kvm' => 'http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-2013-06-12-master-kvm.qcow2.bz2',
'lxc' => 'http://d21ifhcun6b1t2.cloudfront.net/templates/acton/acton-systemvm-02062012.qcow2.bz2'
}
# when ? : if system VM template not define cloudstack_system_template will look
# for the URL define into cloudstack database.
end
default['cloudstack']['systemvm'] = {
'xenserver' => 'http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-2013-07-12-master-xen.vhd.bz2',
'vmware' => 'http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-4.2-vh7.ova',
'kvm' => 'http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-2013-06-12-master-kvm.qcow2.bz2',
'lxc' => 'http://d21ifhcun6b1t2.cloudfront.net/templates/acton/acton-systemvm-02062012.qcow2.bz2',
}
end
8 changes: 4 additions & 4 deletions attributes/vhd-util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Cookbook Name:: cloudstack
# Attribute:: vhd-util
# Author:: Pierre-Luc Dion (<pdion@cloudops.com>)
# Copyright 2015, CloudOps, Inc.
# Copyright 2018, CloudOps, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,6 @@
# limitations under the License.
#

# FOLLOWING ATTRIBUTES SHOULD NOT REQUIRE MODIFICATION
default['cloudstack']['vhd-util_url'] = "http://download.cloud.com.s3.amazonaws.com/tools/vhd-util"
default['cloudstack']['vhd-util_path'] = "/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver"
# FOLLOWING ATTRIBUTES SHOULD NOT REQUIRE MODIFICATION
default['cloudstack']['vhd-util_url'] = 'http://download.cloud.com.s3.amazonaws.com/tools/vhd-util'
default['cloudstack']['vhd-util_path'] = '/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver'
Loading

0 comments on commit b6916e5

Please sign in to comment.