Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using puppetlabs-apt #134

Merged
merged 2 commits into from
Sep 6, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
GEM
remote: https://rubygems.org/
specs:
builder (3.2.2)
diff-lcs (1.2.4)
facter (1.7.1)
hiera (1.2.1)
json_pure
highline (1.6.19)
json (1.8.0)
json_pure (1.8.0)
kwalify (0.7.2)
librarian (0.1.0)
highline
thor (~> 0.15)
Expand All @@ -19,6 +21,9 @@ GEM
mime-types (1.23)
mocha (0.14.0)
metaclass (~> 0.0.1)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.6.8)
nokogiri (1.5.9)
puppet (3.2.1)
facter (~> 1.6)
Expand All @@ -37,6 +42,10 @@ GEM
rspec (>= 2.9.0)
rspec-puppet (>= 0.1.1)
rake (10.0.4)
rbvmomi (1.6.0)
builder
nokogiri (>= 1.4.1)
trollop
rest-client (1.6.7)
mime-types (>= 1.16)
rgen (0.6.2)
Expand All @@ -50,7 +59,26 @@ GEM
rspec-mocks (2.13.1)
rspec-puppet (0.1.6)
rspec
rspec-system (2.2.0)
kwalify (~> 0.7.2)
net-scp (~> 1.1)
net-ssh (~> 2.6)
nokogiri (~> 1.5.9)
rbvmomi (~> 1.6)
rspec (~> 2.13)
systemu (~> 2.5)
rspec-system-puppet (2.2.0)
rspec-system (~> 2.0)
rspec-system-serverspec (1.0.0)
rspec-system (~> 2.0)
serverspec (~> 0.6.0)
serverspec (0.6.3)
highline
net-ssh
rspec (~> 2.0)
systemu (2.5.2)
thor (0.18.1)
trollop (2.0)

PLATFORMS
ruby
Expand All @@ -63,3 +91,6 @@ DEPENDENCIES
puppetlabs_spec_helper
rake (>= 0.9.2.2)
rspec-puppet (>= 0.1.3)
rspec-system-puppet
rspec-system-serverspec
serverspec
1 change: 1 addition & 0 deletions Modulefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ description 'This module can be used for basic NGINX Management'
project_page 'http://github.com/jfryman/puppet-nginx'

dependency 'puppetlabs/stdlib', '>= 0.1.6'
dependency 'puppetlabs/apt', '>= 1.0.0'
23 changes: 8 additions & 15 deletions manifests/package/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# This class file is not called directly
class nginx::package::debian {
$operatingsystem_lowercase = inline_template('<%= @operatingsystem.downcase %>')
$distro = downcase($::operatingsystem)

package { 'nginx':
ensure => $nginx::package_ensure,
Expand All @@ -23,28 +23,21 @@

anchor { 'nginx::apt_repo' : }

file { '/etc/apt/sources.list.d/nginx.list':
ensure => present,
content => "deb http://nginx.org/packages/${operatingsystem_lowercase}/ ${::lsbdistcodename} nginx
deb-src http://nginx.org/packages/${operatingsystem_lowercase}/ ${::lsbdistcodename} nginx
",
mode => '0444',
require => Exec['add_nginx_apt_key'],
before => Anchor['nginx::apt_repo'],
}
include '::apt'

exec { 'add_nginx_apt_key':
command => '/usr/bin/wget http://nginx.org/keys/nginx_signing.key -O - | /usr/bin/apt-key add -',
unless => '/usr/bin/apt-key list | /bin/grep -q nginx',
before => Anchor['nginx::apt_repo'],
apt::source { 'nginx':
location => "http://nginx.org/packages/${distro}",
repos => 'nginx',
key => '7BD9BF62',
key_source => 'http://nginx.org/keys/nginx_signing.key',
}

exec { 'apt_get_update_for_nginx':
command => '/usr/bin/apt-get update',
timeout => 240,
returns => [ 0, 100 ],
refreshonly => true,
subscribe => File['/etc/apt/sources.list.d/nginx.list'],
subscribe => Apt::Source['nginx'],
before => Anchor['nginx::apt_repo'],
}
}
4 changes: 2 additions & 2 deletions manifests/resource/location.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# with nginx::resource::upstream
# [*proxy_read_timeout*] - Override the default the proxy read timeout value of 90 seconds
# [*fastcgi*] - location of fastcgi (host:port)
# [*fastcgi_params*] - optional alternative fastcgi_params file to use
# [*fastcgi_script*] - optional SCRIPT_FILE parameter
# [*fastcgi_params*] - optional alternative fastcgi_params file to use
# [*fastcgi_script*] - optional SCRIPT_FILE parameter
# [*fastcgi_split_path*] - Allows settings of fastcgi_split_path_info so that you can split the script_name and path_info via regex
# [*ssl*] - Indicates whether to setup SSL bindings for this location.
# [*ssl_only*] - Required if the SSL and normal vHost have the same port.
Expand Down