From 36a3b333799a7655100032dbbdf4c4138380a667 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Thu, 13 Aug 2015 16:56:55 -0700 Subject: [PATCH] Add Gemfile and puppet 4 checks In anticipation of puppet 4, start trying to deal with puppet 4 things that can be helpfully predicted by puppet lint plugins. Also fix errors caught by the puppet-lint-absolute_classname-check gem. Change-Id: I34bb706397bff9c5d8239c7ae7f5402c1ca9b118 --- .gitignore | 4 +++- Gemfile | 30 ++++++++++++++++++++++++++++++ manifests/apache/http.pp | 6 +++--- manifests/apache/https.pp | 6 +++--- manifests/api.pp | 4 ++-- manifests/mysql.pp | 2 +- vagrant.pp | 2 +- 7 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 Gemfile diff --git a/.gitignore b/.gitignore index f27d2c9..caeb880 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .vagrant .DS_Store .idea -*.iml \ No newline at end of file +*.iml +Gemfile.lock +.bundled_gems/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..96912da --- /dev/null +++ b/Gemfile @@ -0,0 +1,30 @@ +source 'https://rubygems.org' + +group :development, :test do + gem 'puppetlabs_spec_helper', :require => false + + gem 'metadata-json-lint' + # This is nice and all, but let's not worry about it until we've actually + # got puppet 4.x sorted + # gem 'puppet-lint-param-docs' + gem 'puppet-lint-absolute_classname-check' + gem 'puppet-lint-absolute_template_path' + gem 'puppet-lint-trailing_newline-check' + + # Puppet 4.x related lint checks + gem 'puppet-lint-unquoted_string-check' + gem 'puppet-lint-empty_string-check' + gem 'puppet-lint-leading_zero-check' + gem 'puppet-lint-variable_contains_upcase' + gem 'puppet-lint-spaceship_operator_without_tag-check' + gem 'puppet-lint-undef_in_function-check' + + if puppetversion = ENV['PUPPET_GEM_VERSION'] + gem 'puppet', puppetversion, :require => false + else + gem 'puppet', '~> 3.0', :require => false + end + +end + +# vim:ft=ruby diff --git a/manifests/apache/http.pp b/manifests/apache/http.pp index aff1fbb..1d141af 100644 --- a/manifests/apache/http.pp +++ b/manifests/apache/http.pp @@ -33,9 +33,9 @@ class refstack::apache::http () { $python_version = $::refstack::params::python_version # Install apache - include apache - include apache::params - include apache::mod::wsgi + include ::apache + include ::apache::params + include ::apache::mod::wsgi # Create a copy of the wsgi file with apache user permissions. file { '/etc/refstack/app.wsgi': diff --git a/manifests/apache/https.pp b/manifests/apache/https.pp index 5290fe1..d2e357f 100644 --- a/manifests/apache/https.pp +++ b/manifests/apache/https.pp @@ -40,9 +40,9 @@ class refstack::apache::https () { $resolved_ssl_ca = $::refstack::params::resolved_ssl_ca # Install apache - include apache - include apache::params - include apache::mod::wsgi + include ::apache + include ::apache::params + include ::apache::mod::wsgi # Create a copy of the wsgi file with apache user permissions. file { '/etc/refstack/app.wsgi': diff --git a/manifests/api.pp b/manifests/api.pp index 9947052..100ef31 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -27,13 +27,13 @@ class refstack::api () { $user = $::refstack::params::user $group = $::refstack::params::group - class { 'python': + class { '::python': version => $python_version, pip => true, dev => true, virtualenv => true, } - include python::install + include ::python::install # Ensure Git is present if !defined(Package['git']) { diff --git a/manifests/mysql.pp b/manifests/mysql.pp index 33ae9be..d3c8c02 100644 --- a/manifests/mysql.pp +++ b/manifests/mysql.pp @@ -27,7 +27,7 @@ class refstack::mysql () { $mysql_user_password = $refstack::params::mysql_user_password # Install MySQL - include mysql::server + include ::mysql::server # Add the refstack database. mysql::db { $mysql_database: diff --git a/vagrant.pp b/vagrant.pp index dad0e00..c057d64 100644 --- a/vagrant.pp +++ b/vagrant.pp @@ -1,5 +1,5 @@ node default { - class { 'refstack': + class { '::refstack': hostname => '192.168.99.88', mysql_user_password => 'refstack', }