Skip to content

Commit a37d376

Browse files
khos2owpdion891
authored andcommitted
Overall refactor of Custom Resources (#18)
* Add license badge * fix cookstyle * Fix markdown lint and formatting * Convert global_settings to new custom resource format * fix cookstyle * Convert api_keys to new custom resource format * Fix server spec test * Ignore FC075 from Foodcritic * Suppress chefspec warning message * Enhance CircleCI config * Fix kitchen on ci pipeline * Use docker driver for kitchen test * Add kitchen-docker gem * Cosmetic formatting * Remove Vagrant installation * Fix for services inside docker container * Add cloudstack version to usage recipe * Add more platforms to kitchen test * Move test recipes to its standalone folder * Update config for centos7 for now * Show ruby version * Install ruby * Add systemvm upload to test * Convert system_template to new custom resource format * Fix function definition typo * Update CI config * Fix systemvm_template resource and serverspec * Fix cookstyle * Cleanup circle config * Bump version to v6.1.0
1 parent c44df9e commit a37d376

28 files changed

+540
-697
lines changed

.circleci/config.yml

+47-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
defaults: &defaults
22
docker:
3-
- image: chef/chefdk
3+
- image: chef/chefdk:3.6.57
44
working_directory: ~/cookbook/cookbook_cloudstack
55

66
version: 2
@@ -19,42 +19,68 @@ jobs:
1919
steps:
2020
- restore_cache:
2121
key: repo-{{ .Environment.CIRCLE_SHA1 }}
22-
- run: chef --version
23-
- run: chef exec cookstyle .
22+
- run:
23+
name: "Chef and Ruby version"
24+
command: |
25+
chef --version
26+
ruby --version
27+
- run:
28+
name: "Check Cookstyle"
29+
command: chef exec cookstyle .
2430

2531
foodcritic:
2632
<<: *defaults
2733
steps:
2834
- restore_cache:
2935
key: repo-{{ .Environment.CIRCLE_SHA1 }}
30-
- run: chef --version
31-
- run: chef exec foodcritic .
36+
- run:
37+
name: "Chef and Ruby version"
38+
command: |
39+
chef --version
40+
ruby --version
41+
- run:
42+
name: "Check Foodcritic"
43+
command: chef exec foodcritic .
3244

3345
chefspec:
3446
<<: *defaults
3547
steps:
3648
- restore_cache:
3749
key: repo-{{ .Environment.CIRCLE_SHA1 }}
38-
- run: chef --version
39-
- run: chef exec rspec spec
50+
- run:
51+
name: "Chef and Ruby version"
52+
command: |
53+
chef --version
54+
ruby --version
55+
- run:
56+
name: "Check Serverspec"
57+
command: chef exec rspec spec
4058

4159
kitchen:
42-
machine:
43-
services:
44-
- docker
45-
working_directory: ~/cookbook/cookbook_cloudstack
60+
machine: true
61+
services:
62+
- docker
4663
steps:
4764
- checkout
48-
- run: |
49-
if ! chef -v; then
50-
wget https://packages.chef.io/files/stable/chefdk/3.5.13/ubuntu/18.04/chefdk_3.5.13-1_amd64.deb
51-
sudo dpkg -i chefdk_3.5.13-1_amd64.deb
52-
fi
53-
- run: chef --version
54-
- run: bundle install
55-
- run: berks install
56-
- run: berks update
57-
- run: KITCHEN_LOCAL_YAML=.kitchen.docker.yml kitchen test --destroy always
65+
- run:
66+
name: "Install Chef"
67+
command: |
68+
wget https://packages.chef.io/files/stable/chefdk/3.6.57/ubuntu/18.04/chefdk_3.6.57-1_amd64.deb
69+
sudo dpkg -i chefdk_3.6.57-1_amd64.deb
70+
- run:
71+
name: "Chef and Ruby version"
72+
command: |
73+
chef --version
74+
ruby --version
75+
- run:
76+
name: "Install Gem, Cookbooks dependencies"
77+
command: |
78+
chef exec bundle install
79+
berks install
80+
berks update
81+
- run:
82+
name: "Run Kitchen test"
83+
command: KITCHEN_LOCAL_YAML=.kitchen.docker.yml kitchen test --destroy always
5884

5985
workflows:
6086
version: 2

.foodcritic

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~FC075

.kitchen.docker.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
driver:
3+
name: docker
4+
5+
provisioner:
6+
name: chef_solo
7+
8+
platforms:
9+
- name: centos-7
10+
driver_config:
11+
run_command: /usr/sbin/init
12+
privileged: true
13+
provision_command:
14+
- systemctl enable sshd.service
15+
16+
suites:
17+
- name: default
18+
run_list:
19+
- recipe[test::all-in-one]
20+
attributes:

.kitchen.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ provisioner:
66
name: chef_solo
77

88
platforms:
9-
# - name: ubuntu-16.04
109
- name: centos-7
1110

1211
suites:
1312
- name: default
1413
run_list:
15-
- recipe[cloudstack::circle-ci]
14+
- recipe[test::all-in-one]
1615
attributes:

Berksfile

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
source 'https://supermarket.chef.io'
22

33
metadata
4+
5+
group :integration do
6+
cookbook 'test', path: 'test/cookbooks/test'
7+
end

CHANGELOG.md

+76-72
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,138 @@
1-
cloudstack CHANGELOG
2-
====================
1+
# cloudstack CHANGELOG
32

4-
This file is used to list changes made in each version of the co-cloudstack cookbook.
3+
This file is used to list changes made in each version of the cloudstack cookbook.
4+
5+
## 6.1.0
6+
7+
- khos2ow - Remove Provider and enhance Custom Resources
8+
- khos2ow - Fix CircleCI configs
9+
10+
## 6.0.1
511

6-
6.0.1
7-
-----
812
- khos2ow - Add missing SystemVM URLs for CloudStack 4.10
913

10-
6.0.0
11-
-----
14+
## 6.0.0
15+
1216
- pdion891 - Fix Chef14 issues on CentOS 7 for cloudstack_setup_database ressource.
13-
- Added circle-ci recipe for automated CI.
14-
- Remove management of sudoers file, pkgs are taking care of it.
17+
- pdion891 - Added circle-ci recipe for automated CI.
18+
- pdion891 - Remove management of sudoers file, pkgs are taking care of it.
19+
20+
## 5.0.0
1521

16-
5.0.0
17-
-----
1822
- pdion891 - update default version to 4.11.
1923
- khos2ow - fixed cookstyle and foodcritic issues.
2024

21-
4.1.2
22-
-----
25+
## 4.1.2
26+
2327
- khos2ow - add default metadata expire to cloudstack repo
2428

25-
4.1.1
26-
-----
29+
## 4.1.1
30+
2731
- khos2ow - add server-id for mysql
2832

29-
4.1.0
30-
-----
33+
## 4.1.0
34+
3135
- khos2ow - add support for enabling/disabling cloudstack repo
3236

33-
4.0.8
34-
-----
35-
- put mysql password in single-quotes, otherwise some hardened passwords are not interpreted correctly and logins fail.
37+
## 4.0.8
38+
39+
- pdion891 - put mysql password in single-quotes, otherwise some hardened passwords are not interpreted correctly and logins fail.
40+
41+
## 4.0.7
3642

37-
4.0.7
38-
-----
3943
- pdion891 - add support for CentOS 7 for ACS 4.10 with JDK8
4044

41-
4.0.5
42-
-----
45+
## 4.0.5
46+
4347
- pdion891 - add repo for mysql-connector-python
4448

45-
4.0.4
46-
-----
49+
## 4.0.4
50+
4751
- pdion891 - update apt repo issue for missing pkg signature.
48-
- fix warning for chef 13.
52+
- pdion891 - fix warning for chef 13.
53+
54+
## 4.0.1
4955

50-
4.0.1
51-
-----
5256
- pdion891 - update release to 4.8 by default
5357

54-
4.0.0
55-
-----
58+
## 4.0.0
59+
5660
- pdion891 - integration to berkshelf and vagrant.
57-
- update for new acs 4.6 release.
61+
- pdion891 - update for new acs 4.6 release.
62+
63+
## 3.1.1
5864

59-
3.1.1
60-
-----
6165
- pdion891 - POST for login authentication use to generate admin api_keys
62-
- update systemvm url for acs 4.5
66+
- pdion891 - update systemvm url for acs 4.5
67+
68+
## 3.1.0
6369

64-
3.1.0
65-
-----
6670
- pdion891 - support cookbook mysql6
6771

68-
3.0.10
69-
------
72+
## 3.0.10
73+
7074
- pdion891 - fix port_open: localhost-> 127.0.0.1
7175

72-
3.0.9
73-
-----
76+
## 3.0.9
77+
7478
- pdion891 - fix sudoers.
7579

76-
3.0.8
77-
-----
80+
## 3.0.8
81+
7882
- pdion891 - update date in header.
79-
- readme typos
83+
- pdion891 - readme typos
84+
85+
## 3.0.7
8086

81-
3.0.7
82-
-----
8387
- pdion891 - rename ``hypervisor_tpl`` by ``systemvm``
8488

85-
3.0.6
86-
-----
89+
## 3.0.6
90+
8791
- pdion891 - update 4.4.1 systemplate urls
8892

89-
3.0.5
90-
-----
93+
## 3.0.5
94+
9195
- pdion891 - fix systemvmtemplate url selection
9296

93-
3.0.4
94-
-----
97+
## 3.0.4
98+
9599
- pdion891 - api_key: major rewrite part1.
96100

97-
3.0.3
98-
-----
101+
## 3.0.3
102+
99103
- pdion891 - api_key: add existing keys validation to fix admin password change.
100104

101-
3.0.2
102-
-----
105+
## 3.0.2
106+
103107
- pdion891 - Add eventlog to rabbitmq config template
104108

105-
3.0.0
106-
-----
109+
## 3.0.0
110+
107111
- pdion891 - Complete rewrite of co-cloudstack as cloudstack using Chef LWRP
108112
- pdion891 - Rename cookbook from co-cloudstack to cloudstack.
109113

110-
2.0.3
111-
-----
114+
## 2.0.3
115+
112116
- pdion891 - Add mysql-conf to configure mysql-server tunings required by CloudStack.
113117

114-
2.0.2
115-
-----
118+
## 2.0.2
119+
116120
- pdion891 - change way of generating APIkeys by querying CloudStack API instead of enabling integration api port.
117121

118-
2.0.0
119-
-----
122+
## 2.0.0
123+
120124
- pdion891 - add support for CS 4.3
121125

122-
1.0.0
123-
-----
126+
## 1.0.0
127+
124128
- pdion891 - add vhd-util recipe
125-
- Update license headers
126-
- Update dependencies for opscode cookbooks
129+
- pdion891 - Update license headers
130+
- pdion891 - Update dependencies for opscode cookbooks
131+
132+
## 0.1.2
127133

128-
0.1.2
129-
-----
130134
- pdion891 - remove use of databag and use attributes instead.
131135

132-
0.1.0
133-
-----
136+
## 0.1.0
137+
134138
- pdion891 - Initial release of co-cloudstack

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ gem 'berkshelf'
1616

1717
gem 'test-kitchen'
1818
gem 'kitchen-vagrant'
19+
gem 'kitchen-docker'

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Build Status](https://circleci.com/gh/cloudops/cookbook_cloudstack.svg?style=svg)](https://circleci.com/gh/cloudops/cookbook_cloudstack)
44
[![Cookbook Version](https://img.shields.io/cookbook/v/cloudstack.svg)](https://supermarket.chef.io/cookbooks/cloudstack)
5+
[![license](https://img.shields.io/github/license/cloudops/cookbook_cloudstack.svg)](https://github.com/cloudops/cookbook_cloudstack/blob/master/LICENSE)
56

67
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.
78

0 commit comments

Comments
 (0)