Skip to content

Commit

Permalink
Support puppetlabs-concat 2.x
Browse files Browse the repository at this point in the history
2.0.0 is compatible with current 1.x usage, so permit either 1.x or 2.x
to satisfy the concat dependency.  Move all ensure parameters from
concat::fragment to concat itself.
  • Loading branch information
Dominic Cleal committed May 29, 2015
1 parent b0c9d27 commit 1919eb3
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
fixtures:
repositories:
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
concat:
repo: "git://github.com/puppetlabs/puppetlabs-concat.git"
branch: "1.2.x"
concat: "git://github.com/puppetlabs/puppetlabs-concat.git"
portage: "git://github.com/gentoo/puppet-portage.git"
symlinks:
apache: "#{source_dir}"
4 changes: 1 addition & 3 deletions manifests/balancer.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
$target = "${::apache::params::confd_dir}/balancer_${name}.conf"

concat { $target:
ensure => present,
owner => '0',
group => '0',
mode => '0644',
notify => Class['Apache::Service'],
}

concat::fragment { "00-${name}-header":
ensure => present,
target => $target,
order => '01',
content => "<Proxy balancer://${name}>\n",
Expand All @@ -67,14 +67,12 @@
# concat fragments. We don't have to do anything about them.

concat::fragment { "01-${name}-proxyset":
ensure => present,
target => $target,
order => '19',
content => inline_template("<% @proxy_set.keys.sort.each do |key| %> Proxyset <%= key %>=<%= @proxy_set[key] %>\n<% end %>"),
}

concat::fragment { "01-${name}-footer":
ensure => present,
target => $target,
order => '20',
content => "</Proxy>\n",
Expand Down
1 change: 0 additions & 1 deletion manifests/balancermember.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
) {

concat::fragment { "BalancerMember ${name}":
ensure => present,
target => "${::apache::params::confd_dir}/balancer_${balancer_cluster}.conf",
content => inline_template(" BalancerMember ${url} <%= @options.join ' ' %>\n"),
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@
}

concat { $ports_file:
ensure => present,
owner => 'root',
group => $::apache::params::root_group,
mode => '0644',
notify => Class['Apache::Service'],
require => Package['httpd'],
}
concat::fragment { 'Apache ports header':
ensure => present,
target => $ports_file,
content => template('apache/ports_header.erb')
}
Expand Down
1 change: 0 additions & 1 deletion manifests/listen.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# Template uses: $listen_addr_port
concat::fragment { "Listen ${listen_addr_port}":
ensure => present,
target => $::apache::ports_file,
content => template('apache/listen.erb'),
}
Expand Down
1 change: 0 additions & 1 deletion manifests/namevirtualhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# Template uses: $addr_port
concat::fragment { "NameVirtualHost ${addr_port}":
ensure => present,
target => $::apache::ports_file,
content => template('apache/namevirtualhost.erb'),
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@
"description": "Module for Apache configuration",
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">= 2.4.0 < 5.0.0"},
{"name":"puppetlabs/concat","version_requirement":">= 1.1.1 < 2.0.0"}
{"name":"puppetlabs/concat","version_requirement":">= 1.1.1 < 3.0.0"}
]
}
6 changes: 3 additions & 3 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
let :facts do default_facts end
it { is_expected.to contain_class("apache") }
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_file("25-rspec.example.com.conf").with(
it { is_expected.to contain_concat("25-rspec.example.com.conf").with(
:ensure => 'present',
:path => '/etc/apache2/sites-available/25-rspec.example.com.conf'
) }
Expand All @@ -77,7 +77,7 @@
let :facts do default_facts end
it { is_expected.to contain_class("apache") }
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_file("25-rspec.example.com.conf").with(
it { is_expected.to contain_concat("25-rspec.example.com.conf").with(
:ensure => 'present',
:path => '/usr/local/etc/apache24/Vhosts/25-rspec.example.com.conf'
) }
Expand All @@ -99,7 +99,7 @@
let :facts do default_facts end
it { is_expected.to contain_class("apache") }
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_file("25-rspec.example.com.conf").with(
it { is_expected.to contain_concat("25-rspec.example.com.conf").with(
:ensure => 'present',
:path => '/etc/apache2/vhosts.d/25-rspec.example.com.conf'
) }
Expand Down

0 comments on commit 1919eb3

Please sign in to comment.