Skip to content

Commit

Permalink
Overall refactor of Custom Resources (#18)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
khos2ow authored and pdion891 committed Jan 4, 2019
1 parent c44df9e commit a37d376
Show file tree
Hide file tree
Showing 28 changed files with 540 additions and 697 deletions.
68 changes: 47 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defaults: &defaults
docker:
- image: chef/chefdk
- image: chef/chefdk:3.6.57
working_directory: ~/cookbook/cookbook_cloudstack

version: 2
Expand All @@ -19,42 +19,68 @@ jobs:
steps:
- restore_cache:
key: repo-{{ .Environment.CIRCLE_SHA1 }}
- run: chef --version
- run: chef exec cookstyle .
- run:
name: "Chef and Ruby version"
command: |
chef --version
ruby --version
- run:
name: "Check Cookstyle"
command: chef exec cookstyle .

foodcritic:
<<: *defaults
steps:
- restore_cache:
key: repo-{{ .Environment.CIRCLE_SHA1 }}
- run: chef --version
- run: chef exec foodcritic .
- run:
name: "Chef and Ruby version"
command: |
chef --version
ruby --version
- run:
name: "Check Foodcritic"
command: chef exec foodcritic .

chefspec:
<<: *defaults
steps:
- restore_cache:
key: repo-{{ .Environment.CIRCLE_SHA1 }}
- run: chef --version
- run: chef exec rspec spec
- run:
name: "Chef and Ruby version"
command: |
chef --version
ruby --version
- run:
name: "Check Serverspec"
command: chef exec rspec spec

kitchen:
machine:
services:
- docker
working_directory: ~/cookbook/cookbook_cloudstack
machine: true
services:
- docker
steps:
- checkout
- run: |
if ! chef -v; then
wget https://packages.chef.io/files/stable/chefdk/3.5.13/ubuntu/18.04/chefdk_3.5.13-1_amd64.deb
sudo dpkg -i chefdk_3.5.13-1_amd64.deb
fi
- run: chef --version
- run: bundle install
- run: berks install
- run: berks update
- run: KITCHEN_LOCAL_YAML=.kitchen.docker.yml kitchen test --destroy always
- run:
name: "Install Chef"
command: |
wget https://packages.chef.io/files/stable/chefdk/3.6.57/ubuntu/18.04/chefdk_3.6.57-1_amd64.deb
sudo dpkg -i chefdk_3.6.57-1_amd64.deb
- run:
name: "Chef and Ruby version"
command: |
chef --version
ruby --version
- run:
name: "Install Gem, Cookbooks dependencies"
command: |
chef exec bundle install
berks install
berks update
- run:
name: "Run Kitchen test"
command: KITCHEN_LOCAL_YAML=.kitchen.docker.yml kitchen test --destroy always

workflows:
version: 2
Expand Down
1 change: 1 addition & 0 deletions .foodcritic
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
~FC075
20 changes: 20 additions & 0 deletions .kitchen.docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
driver:
name: docker

provisioner:
name: chef_solo

platforms:
- name: centos-7
driver_config:
run_command: /usr/sbin/init
privileged: true
provision_command:
- systemctl enable sshd.service

suites:
- name: default
run_list:
- recipe[test::all-in-one]
attributes:
3 changes: 1 addition & 2 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ provisioner:
name: chef_solo

platforms:
# - name: ubuntu-16.04
- name: centos-7

suites:
- name: default
run_list:
- recipe[cloudstack::circle-ci]
- recipe[test::all-in-one]
attributes:
4 changes: 4 additions & 0 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
source 'https://supermarket.chef.io'

metadata

group :integration do
cookbook 'test', path: 'test/cookbooks/test'
end
148 changes: 76 additions & 72 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,134 +1,138 @@
cloudstack CHANGELOG
====================
# cloudstack CHANGELOG

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

## 6.1.0

- khos2ow - Remove Provider and enhance Custom Resources
- khos2ow - Fix CircleCI configs

## 6.0.1

6.0.1
-----
- khos2ow - Add missing SystemVM URLs for CloudStack 4.10

6.0.0
-----
## 6.0.0

- pdion891 - Fix Chef14 issues on CentOS 7 for cloudstack_setup_database ressource.
- Added circle-ci recipe for automated CI.
- Remove management of sudoers file, pkgs are taking care of it.
- pdion891 - Added circle-ci recipe for automated CI.
- pdion891 - Remove management of sudoers file, pkgs are taking care of it.

## 5.0.0

5.0.0
-----
- pdion891 - update default version to 4.11.
- khos2ow - fixed cookstyle and foodcritic issues.

4.1.2
-----
## 4.1.2

- khos2ow - add default metadata expire to cloudstack repo

4.1.1
-----
## 4.1.1

- khos2ow - add server-id for mysql

4.1.0
-----
## 4.1.0

- khos2ow - add support for enabling/disabling cloudstack repo

4.0.8
-----
- put mysql password in single-quotes, otherwise some hardened passwords are not interpreted correctly and logins fail.
## 4.0.8

- pdion891 - put mysql password in single-quotes, otherwise some hardened passwords are not interpreted correctly and logins fail.

## 4.0.7

4.0.7
-----
- pdion891 - add support for CentOS 7 for ACS 4.10 with JDK8

4.0.5
-----
## 4.0.5

- pdion891 - add repo for mysql-connector-python

4.0.4
-----
## 4.0.4

- pdion891 - update apt repo issue for missing pkg signature.
- fix warning for chef 13.
- pdion891 - fix warning for chef 13.

## 4.0.1

4.0.1
-----
- pdion891 - update release to 4.8 by default

4.0.0
-----
## 4.0.0

- pdion891 - integration to berkshelf and vagrant.
- update for new acs 4.6 release.
- pdion891 - update for new acs 4.6 release.

## 3.1.1

3.1.1
-----
- pdion891 - POST for login authentication use to generate admin api_keys
- update systemvm url for acs 4.5
- pdion891 - update systemvm url for acs 4.5

## 3.1.0

3.1.0
-----
- pdion891 - support cookbook mysql6

3.0.10
------
## 3.0.10

- pdion891 - fix port_open: localhost-> 127.0.0.1

3.0.9
-----
## 3.0.9

- pdion891 - fix sudoers.

3.0.8
-----
## 3.0.8

- pdion891 - update date in header.
- readme typos
- pdion891 - readme typos

## 3.0.7

3.0.7
-----
- pdion891 - rename ``hypervisor_tpl`` by ``systemvm``

3.0.6
-----
## 3.0.6

- pdion891 - update 4.4.1 systemplate urls

3.0.5
-----
## 3.0.5

- pdion891 - fix systemvmtemplate url selection

3.0.4
-----
## 3.0.4

- pdion891 - api_key: major rewrite part1.

3.0.3
-----
## 3.0.3

- pdion891 - api_key: add existing keys validation to fix admin password change.

3.0.2
-----
## 3.0.2

- pdion891 - Add eventlog to rabbitmq config template

3.0.0
-----
## 3.0.0

- pdion891 - Complete rewrite of co-cloudstack as cloudstack using Chef LWRP
- pdion891 - Rename cookbook from co-cloudstack to cloudstack.

2.0.3
-----
## 2.0.3

- pdion891 - Add mysql-conf to configure mysql-server tunings required by CloudStack.

2.0.2
-----
## 2.0.2

- pdion891 - change way of generating APIkeys by querying CloudStack API instead of enabling integration api port.

2.0.0
-----
## 2.0.0

- pdion891 - add support for CS 4.3

1.0.0
-----
## 1.0.0

- pdion891 - add vhd-util recipe
- Update license headers
- Update dependencies for opscode cookbooks
- pdion891 - Update license headers
- pdion891 - Update dependencies for opscode cookbooks

## 0.1.2

0.1.2
-----
- pdion891 - remove use of databag and use attributes instead.

0.1.0
-----
## 0.1.0

- pdion891 - Initial release of co-cloudstack
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ gem 'berkshelf'

gem 'test-kitchen'
gem 'kitchen-vagrant'
gem 'kitchen-docker'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

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.

Expand Down
Loading

0 comments on commit a37d376

Please sign in to comment.