Alexandros Kosiaris has uploaded a new change for review. https://gerrit.wikimedia.org/r/179488
Change subject: Remove module url_downloader ...................................................................... Remove module url_downloader No point in maintaining a module that is a single call of a class of another module. Move that single class in the role class, move the template around and kill the module. Change-Id: I8af93c74bc03d1caaf98fa2f18dd221e9a96c9b1 --- M manifests/role/url_downloader.pp D modules/url_downloader/.rspec D modules/url_downloader/README.md D modules/url_downloader/Rakefile D modules/url_downloader/manifests/init.pp D modules/url_downloader/spec/classes/urldownloader_spec.rb D modules/url_downloader/spec/fixtures/manifests/site.pp D modules/url_downloader/spec/spec_helper.rb D modules/url_downloader/tests/Makefile D modules/url_downloader/tests/init.pp R templates/url_downloader/squid.conf.erb 11 files changed, 2 insertions(+), 123 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/88/179488/1 diff --git a/manifests/role/url_downloader.pp b/manifests/role/url_downloader.pp index 09844e2..abfcc06 100644 --- a/manifests/role/url_downloader.pp +++ b/manifests/role/url_downloader.pp @@ -26,8 +26,8 @@ description => 'Upload-by-URL proxy' } - class { '::url_downloader': - service_ip => $url_downloader_ip + class { 'squid3': + config_content => template('url_downloader/squid.conf.erb'), } # Firewall diff --git a/modules/url_downloader/.rspec b/modules/url_downloader/.rspec deleted file mode 100644 index f449dae..0000000 --- a/modules/url_downloader/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---format doc ---color diff --git a/modules/url_downloader/README.md b/modules/url_downloader/README.md deleted file mode 100644 index 536ef4a..0000000 --- a/modules/url_downloader/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# url\_downloader Puppet Module # - -A Puppet module for installing and configuring a forward proxy used to fetch URLs - -## Requirements ## -- An Ubuntu distro - -## Notes ## - -A public IP is required to use this module. It is the IP on which the squid -proxy will listen on and the one used to initiate connections fetching URLs - -## Usage ## -### Configure your url\_downloader ### - - class { '::url_downloader': - service_ip => '10.10.10.10' # But please choose a public IP - } diff --git a/modules/url_downloader/Rakefile b/modules/url_downloader/Rakefile deleted file mode 100644 index d9226a8..0000000 --- a/modules/url_downloader/Rakefile +++ /dev/null @@ -1,37 +0,0 @@ -require 'rake' -require 'fileutils' - -require 'rspec/core/rake_task' - -modulename = File.basename(File.expand_path(File.dirname(__FILE__))) - -symlinks = { 'spec/fixtures/modules/%s/files' % modulename => '../../../../files', - 'spec/fixtures/modules/%s/manifests' % modulename => '../../../../manifests', - 'spec/fixtures/modules/%s/templates' % modulename => '../../../../templates', -} - - -task :setup do - FileUtils.mkdir_p('spec/fixtures/modules/%s' % modulename) - symlinks.each do |x| - if !File.exist?(x[0]) - FileUtils.ln_s(x[1], x[0]) - end - end -end - -task :teardown do - symlinks.each { |x| FileUtils.rm(x[0], :force => true) } - FileUtils.rmdir('spec/fixtures/modules/%s' % modulename) - FileUtils.rmdir('spec/fixtures/modules') -end - -RSpec::Core::RakeTask.new(:realspec) do |t| - t.fail_on_error = false - t.pattern = 'spec/*/*_spec.rb' -end - -task :spec => [ :setup, :realspec, :teardown] - -task :default => :spec do -end diff --git a/modules/url_downloader/manifests/init.pp b/modules/url_downloader/manifests/init.pp deleted file mode 100644 index 5a6cee1..0000000 --- a/modules/url_downloader/manifests/init.pp +++ /dev/null @@ -1,22 +0,0 @@ -# Class: url_downloader -# -# This class installs squid as a forward proxy for fetching URLs -# -# Parameters: -# $service_ip -# The IP on which the proxy listens on and uses to fetch URLs -# -# Actions: -# Install squid and configure it as a forward fetching proxy -# -# Requires: -# -# Sample Usage: -# class { '::url_downloader': -# service_ip => '10.10.10.10' # Probably a public ip though -# } -class url_downloader($service_ip) { - class { 'squid3': - config_content => template('url_downloader/squid.conf.erb'), - } -} diff --git a/modules/url_downloader/spec/classes/urldownloader_spec.rb b/modules/url_downloader/spec/classes/urldownloader_spec.rb deleted file mode 100644 index eb49c19..0000000 --- a/modules/url_downloader/spec/classes/urldownloader_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'spec_helper' - -describe 'url_downloader', :type => :class do - let(:node) { 'testhost.example.com' } - let(:params) { { - :service_ip => '10.10.10.10', - } - } - - it { should contain_package('squid3') } - it { should contain_service('squid3') } - it { should contain_file('/etc/squid3/squid.conf'). - with_content(/10.10.10.10/). - with_content(/^acl (?! all src)/) - } -end diff --git a/modules/url_downloader/spec/fixtures/manifests/site.pp b/modules/url_downloader/spec/fixtures/manifests/site.pp deleted file mode 100644 index e69de29..0000000 --- a/modules/url_downloader/spec/fixtures/manifests/site.pp +++ /dev/null diff --git a/modules/url_downloader/spec/spec_helper.rb b/modules/url_downloader/spec/spec_helper.rb deleted file mode 100644 index d3923f8..0000000 --- a/modules/url_downloader/spec/spec_helper.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'rspec-puppet' - -fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) - -RSpec.configure do |c| - c.module_path = File.join(fixture_path, 'modules') - c.manifest_dir = File.join(fixture_path, 'manifests') -end diff --git a/modules/url_downloader/tests/Makefile b/modules/url_downloader/tests/Makefile deleted file mode 100644 index 76cd656..0000000 --- a/modules/url_downloader/tests/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -MANIFESTS=$(wildcard *.pp) -OBJS=$(MANIFESTS:.pp=.po) -TESTS_DIR=$(dir $(CURDIR)) -MODULE_DIR=$(TESTS_DIR:/=) -MODULES_DIR=$(dir $(MODULE_DIR)) - -all: test - -test: $(OBJS) - -%.po: %.pp - puppet parser validate $< - puppet apply --noop --modulepath $(MODULES_DIR) $< diff --git a/modules/url_downloader/tests/init.pp b/modules/url_downloader/tests/init.pp deleted file mode 100644 index 9bd9554..0000000 --- a/modules/url_downloader/tests/init.pp +++ /dev/null @@ -1,5 +0,0 @@ -# - -class { '::url_downloader': - service_ip => '10.10.10.10', -} diff --git a/modules/url_downloader/templates/squid.conf.erb b/templates/url_downloader/squid.conf.erb similarity index 100% rename from modules/url_downloader/templates/squid.conf.erb rename to templates/url_downloader/squid.conf.erb -- To view, visit https://gerrit.wikimedia.org/r/179488 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8af93c74bc03d1caaf98fa2f18dd221e9a96c9b1 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Alexandros Kosiaris <akosia...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits