Skip to content

Commit 98adaa3

Browse files
author
salmankh
committed
Merge pull request #2 from openstack/stable/liberty
Stable/liberty
2 parents d0de990 + 47a0c63 commit 98adaa3

36 files changed

Lines changed: 1265 additions & 566 deletions

.fixtures.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.gitignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
*.swp
2-
spec/fixtures/*
3-
pkg
1+
pkg/
42
Gemfile.lock
3+
vendor/
4+
spec/fixtures/
5+
.vagrant/
6+
.bundle/
7+
coverage/
8+
.idea/
9+
*.swp
10+
*.iml
11+
openstack/

.gitreview

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[gerrit]
22
host=review.openstack.org
33
port=29418
4-
project=stackforge/puppet-openstacklib.git
4+
project=openstack/puppet-openstacklib.git

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
##2015-11-24 - 7.0.0
2+
###Summary
3+
4+
This is a backwards-compatible major release for OpenStack Liberty.
5+
6+
####Features
7+
- fallback to default rcfile
8+
- prepare $::os_package_type
9+
- add a proxy inifile provider
10+
- allow the use of an ensure_absent_val param
11+
- create is_service_default function
12+
- create os_service_default fact
13+
- allow to path custom fragment to vhost
14+
- pass necessary options to Apache when using WSGI
15+
16+
####Bugfixes
17+
- fix fact for puppet facter 2.0.1+
18+
19+
####Maintenance
20+
- initial msync run for all Puppet OpenStack modules
21+
- enable acceptance tests for openstack_config
22+
- remove class_parameter_defaults puppet-lint check
23+
24+
##2015-10-10 - 6.1.0
25+
###Summary
26+
27+
This is a maintenance release in the Kilo series.
28+
29+
####Maintenance
30+
- acceptance: checkout stable/kilo puppet modules
31+
32+
##2015-07-08 - 6.0.0
33+
###Summary
34+
35+
This is a backwards-incompatible major release for OpenStack Kilo.
36+
37+
####Backwards-incompatible changes
38+
- MySQL: change default MySQL collate to utf8_general_ci
39+
40+
####Features
41+
- Puppet 4.x support
42+
- Add db::postgresql to openstacklib
43+
- Implement openstacklib::wsgi::apache
44+
- Move openstackclient parent provider to openstacklib
45+
- Keystone V3 API support
46+
- Restructures authentication for resource providers
47+
48+
####Bugfixes
49+
- Properly handle policy values containing spaces
50+
51+
####Maintenance
52+
- Bump mysql version to 3.x
53+
- Acceptance tests with Beaker
54+
55+
##2015-06-17 - 5.1.0
56+
###Summary
57+
58+
This is a feature and bugfix release in the Juno series.
59+
60+
####Features
61+
- Adding augeas insertion check
62+
63+
####Bugfixes
64+
- MySQL: change default MySQL collate to utf8_general_ci
65+
66+
####Maintenance
67+
- Update .gitreview file for project rename
68+
- spec: pin rspec-puppet to 1.0.1
69+
70+
##2014-11-25 - 5.0.0
71+
###Summary
72+
73+
Initial release for Juno.

Gemfile

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
source 'https://rubygems.org'
1+
source ENV['GEM_SOURCE'] || "https://rubygems.org"
22

33
group :development, :test do
4-
gem 'puppetlabs_spec_helper', :require => false
5-
gem 'rspec-puppet', '~> 2.1.0', :require => false
6-
gem 'minitest', '~> 4.7', :require => 'minitest/unit'
7-
8-
gem 'puppet-lint', '~> 1.1.0'
9-
gem 'metadata-json-lint'
10-
gem 'puppet-lint-param-docs'
11-
gem 'puppet-lint-absolute_classname-check'
12-
gem 'puppet-lint-absolute_template_path'
13-
gem 'puppet-lint-trailing_newline-check'
4+
gem 'puppetlabs_spec_helper', :require => 'false'
5+
gem 'rspec-puppet', '~> 2.2.0', :require => 'false'
6+
gem 'metadata-json-lint', :require => 'false'
7+
gem 'puppet-lint-param-docs', :require => 'false'
8+
gem 'puppet-lint-absolute_classname-check', :require => 'false'
9+
gem 'puppet-lint-absolute_template_path', :require => 'false'
10+
gem 'puppet-lint-trailing_newline-check', :require => 'false'
11+
gem 'puppet-lint-unquoted_string-check', :require => 'false'
12+
gem 'puppet-lint-leading_zero-check', :require => 'false'
13+
gem 'puppet-lint-variable_contains_upcase', :require => 'false'
14+
gem 'puppet-lint-numericvariable', :require => 'false'
15+
gem 'json', :require => 'false'
16+
gem 'webmock', :require => 'false'
17+
end
1418

15-
# Puppet 4.x related lint checks
16-
gem 'puppet-lint-unquoted_string-check'
17-
gem 'puppet-lint-leading_zero-check'
18-
gem 'puppet-lint-variable_contains_upcase'
19-
gem 'puppet-lint-numericvariable'
19+
group :system_tests do
20+
gem 'beaker-rspec', :require => 'false'
21+
gem 'beaker-puppet_install_helper', :require => 'false'
22+
gem 'r10k', :require => 'false'
23+
end
2024

21-
gem 'beaker-rspec', '~> 2.2.4', :require => false
22-
gem 'mocha'
23-
gem 'json'
25+
if facterversion = ENV['FACTER_GEM_VERSION']
26+
gem 'facter', facterversion, :require => false
27+
else
28+
gem 'facter', :require => false
2429
end
2530

2631
if puppetversion = ENV['PUPPET_GEM_VERSION']

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
openstacklib
22
============
33

4-
5.0.0 - 2014.2.0 - Juno
4+
7.0.0 - 2015.2 - Liberty
5+
56
#### Table of Contents
67

78
1. [Overview - What is the openstacklib module?](#overview)
@@ -11,12 +12,11 @@ openstacklib
1112
5. [Limitations - OS compatibility, etc.](#limitations)
1213
6. [Development - Guide for contributing to the module](#development)
1314
7. [Contributors - Those with commits](#contributors)
14-
8. [Release Notes - Notes on the most recent updates to the module](#release-notes)
1515

1616
Overview
1717
--------
1818

19-
The openstacklib module is a part of [Stackforge](https://github.com/stackforge),
19+
The openstacklib module is a part of [OpenStack](https://github.com/openstack),
2020
an effort by the Openstack infrastructure team to provide continuous integration
2121
testing and code review for Openstack and Openstack community projects not part
2222
of the core software. The module itself is used to expose common functionality
@@ -38,7 +38,7 @@ Setup
3838

3939
### Installing openstacklib
4040

41-
example% puppet module install puppetlabs/openstacklib
41+
puppet module install openstack/openstacklib
4242

4343
Usage
4444
-----
@@ -324,11 +324,6 @@ Puppet Module :: OpenStack Version :: OpenStack Codename
324324
3.0.0 -> 2013.2.0 -> Havana
325325
4.0.0 -> 2014.1.0 -> Icehouse
326326
5.0.0 -> 2014.2.0 -> Juno
327+
6.0.0 -> 2015.1.0 -> Kilo
328+
7.0.0 -> 2015.2.0 -> Liberty
327329
```
328-
329-
Release Notes
330-
-------------
331-
332-
**5.0.0**
333-
334-
* This is the initial release of this module.

Rakefile

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,85 @@
1-
require 'rubygems'
21
require 'puppetlabs_spec_helper/rake_tasks'
32
require 'puppet-lint/tasks/puppet-lint'
3+
require 'puppet-syntax/tasks/puppet-syntax'
4+
require 'json'
45

5-
PuppetLint.configuration.fail_on_warnings = true
6-
PuppetLint.configuration.send('disable_80chars')
7-
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
6+
modname = JSON.parse(open('metadata.json').read)['name'].split('-')[1]
7+
8+
PuppetSyntax.exclude_paths ||= []
9+
PuppetSyntax.exclude_paths << "spec/fixtures/**/*"
10+
PuppetSyntax.exclude_paths << "pkg/**/*"
11+
PuppetSyntax.exclude_paths << "vendor/**/*"
12+
13+
Rake::Task[:lint].clear
14+
PuppetLint::RakeTask.new :lint do |config|
15+
config.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"]
16+
config.fail_on_warnings = true
17+
config.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}'
18+
config.disable_checks = ["80chars", "class_inherits_from_params_class", "only_variable_string"]
19+
end
20+
21+
desc "Run acceptance tests"
22+
RSpec::Core::RakeTask.new(:acceptance) do |t|
23+
t.pattern = 'spec/acceptance'
24+
end
25+
26+
Rake::Task[:spec_prep].clear
27+
desc 'Create the fixtures directory'
28+
task :spec_prep do
29+
# Allow to test the module with custom dependencies
30+
# like you could do with .fixtures file
31+
if ENV['PUPPETFILE']
32+
puppetfile = ENV['PUPPETFILE']
33+
if ENV['GEM_HOME']
34+
gem_home = ENV['GEM_HOME']
35+
gem_bin_dir = "#{gem_home}" + '/bin/'
36+
else
37+
gem_bin_dir = ''
38+
end
39+
r10k = ['env']
40+
r10k += ["PUPPETFILE=#{puppetfile}"]
41+
r10k += ["PUPPETFILE_DIR=#{Dir.pwd}/spec/fixtures/modules"]
42+
r10k += ["#{gem_bin_dir}r10k"]
43+
r10k += ['puppetfile', 'install', '-v']
44+
sh(*r10k)
45+
else
46+
# otherwise, use official OpenStack Puppetfile
47+
zuul_ref = ENV['ZUUL_REF']
48+
zuul_branch = ENV['ZUUL_BRANCH']
49+
zuul_url = ENV['ZUUL_URL']
50+
repo = 'openstack/puppet-openstack-integration'
51+
rm_rf(repo)
52+
if File.exists?('/usr/zuul-env/bin/zuul-cloner')
53+
zuul_clone_cmd = ['/usr/zuul-env/bin/zuul-cloner']
54+
zuul_clone_cmd += ['--cache-dir', '/opt/git']
55+
zuul_clone_cmd += ['--zuul-ref', "#{zuul_ref}"]
56+
zuul_clone_cmd += ['--zuul-branch', "#{zuul_branch}"]
57+
zuul_clone_cmd += ['--zuul-url', "#{zuul_url}"]
58+
zuul_clone_cmd += ['git://git.openstack.org', "#{repo}"]
59+
sh(*zuul_clone_cmd)
60+
else
61+
sh("git clone https://git.openstack.org/#{repo} -b stable/liberty #{repo}")
62+
end
63+
script = ['env']
64+
script += ["PUPPETFILE_DIR=#{Dir.pwd}/spec/fixtures/modules"]
65+
script += ["ZUUL_REF=#{zuul_ref}"]
66+
script += ["ZUUL_BRANCH=#{zuul_branch}"]
67+
script += ["ZUUL_URL=#{zuul_url}"]
68+
script += ['bash', "#{repo}/install_modules_unit.sh"]
69+
sh(*script)
70+
end
71+
rm_rf("spec/fixtures/modules/#{modname}")
72+
ln_s(Dir.pwd, "spec/fixtures/modules/#{modname}")
73+
mkdir_p('spec/fixtures/manifests')
74+
touch('spec/fixtures/manifests/site.pp')
75+
end
76+
77+
Rake::Task[:spec_clean].clear
78+
desc 'Clean up the fixtures directory'
79+
task :spec_clean do
80+
rm_rf('spec/fixtures/modules')
81+
rm_rf('openstack')
82+
if File.zero?('spec/fixtures/manifests/site.pp')
83+
rm_f('spec/fixtures/manifests/site.pp')
84+
end
85+
end

facts.d/os_service_default.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
os_service_default=<SERVICE DEFAULT>

lib/facter/os_package_type.rb

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# We need this to be able to make decision of what style of package we are
3+
# working with: Debian style package (for example, it uses a nova-consoleproxy
4+
# package and not nova-novncproxy, or it has a openstack-dashboard-apache,
5+
# etc.), or just the Ubuntu style package.
6+
#
7+
# This is needed, because in some cases, we are using the Debian style packages
8+
# but running under Ubuntu. For example, that's the case when running with MOS
9+
# over Ubuntu. For this case, a manual override is provided, in the form of a
10+
# /etc/facter/facts.d/os_package_type.txt containing:
11+
# os_package_type=debian
12+
#
13+
# In all other cases, we can consider that we're using vanilia (ie: unmodified)
14+
# distribution packages, and we can set $::os_package_type depending on the
15+
# value of $::operatingsystem.
16+
#
17+
# Having the below snipets helps simplifying checks within individual project
18+
# manifests, so that we can just reuse $::os_package_type directly without
19+
# having to also check if it contains a value, then check for the content of
20+
# $::operatingsystem (ie: what's below factors the check once and for all).
21+
Facter.add('os_package_type') do
22+
setcode do
23+
case Facter.value(:osfamily)
24+
when 'Debian'
25+
if Facter.value(:operatingsystem) == 'Debian' then
26+
'debian'
27+
else
28+
'ubuntu'
29+
end
30+
when 'RedHat'
31+
'rpm'
32+
when 'Solaris'
33+
'solaris'
34+
else
35+
'unknown'
36+
end
37+
end
38+
end

lib/facter/os_service_default.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# This adds the os_service_default fact for people with facter < 2.0.1
3+
# For people with facter >= 2.0.1, the facts.d/os_services_default.txt should
4+
# provide this information
5+
#
6+
require 'puppet/util/package'
7+
8+
if Puppet::Util::Package.versioncmp(Facter.value(:facterversion), '2.0.1') < 0
9+
Facter.add('os_service_default') do
10+
setcode do
11+
'<SERVICE DEFAULT>'
12+
end
13+
end
14+
end

0 commit comments

Comments
 (0)