1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fixtures:
mysql: 'https://github.com/puppetlabs/puppetlabs-mysql'
postgresql: 'https://github.com/puppetlabs/puppetlabs-postgresql'
puppet: 'https://github.com/theforeman/puppet-puppet'
systemd: 'https://github.com/camptocamp/puppet-systemd'
selinux_core:
repo: "https://github.com/puppetlabs/puppetlabs-selinux_core"
puppet_version: ">= 6.0.0"
Expand Down
14 changes: 1 addition & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
---
# This file is managed centrally by modulesync
# https://github.com/theforeman/foreman-installer-modulesync
rvm:
- 2.1.9
- 2.3.0
- 2.4.1
env:
matrix:
- PUPPET_VERSION=4.9
global:
- PARALLEL_TEST_PROCESSORS=8
matrix:
fast_finish: true
include:
- rvm: 2.4.1
env: PUPPET_VERSION=5.0
- rvm: 2.5.1
env: PUPPET_VERSION=5.0
- rvm: 2.5.1
env: PUPPET_VERSION=6.0
# Acceptance tests
Expand Down Expand Up @@ -65,8 +57,4 @@ matrix:
- sudo service docker restart

bundler_args: --without system_tests development
before_install:
- if [ $TRAVIS_RUBY_VERSION = 2.1.9 ] ; then
gem install -v 1.17.3 bundler --no-rdoc --no-ri;
fi
sudo: false
dist: xenial
44 changes: 38 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## [12.0.0](https://github.com/theforeman/puppet-foreman/tree/12.0.0) (2019-04-18)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/11.0.1...12.0.0)

**Breaking changes:**

- Drop support for $use\_vhost [\#726](https://github.com/theforeman/puppet-foreman/pull/726) ([ekohl](https://github.com/ekohl))
- Refactor running with a service to Foreman 1.22 [\#723](https://github.com/theforeman/puppet-foreman/pull/723) ([ekohl](https://github.com/ekohl))
- drop Puppet 4 [\#719](https://github.com/theforeman/puppet-foreman/pull/719) ([mmoll](https://github.com/mmoll))

**Implemented enhancements:**

- Add Parameters for jobs\_service [\#725](https://github.com/theforeman/puppet-foreman/pull/725) ([cocker-cc](https://github.com/cocker-cc))
- Refactor f::config::passenger to f::config::apache [\#722](https://github.com/theforeman/puppet-foreman/pull/722) ([ekohl](https://github.com/ekohl))
- Add certname to error output in external\_node\_v2.rb [\#718](https://github.com/theforeman/puppet-foreman/pull/718) ([antaflos](https://github.com/antaflos))
- Avoid processing fact yaml files with empty 'values' hash [\#717](https://github.com/theforeman/puppet-foreman/pull/717) ([antaflos](https://github.com/antaflos))
- Expose options to the http and https vhosts [\#716](https://github.com/theforeman/puppet-foreman/pull/716) ([ekohl](https://github.com/ekohl))
- add cors domains parameter [\#715](https://github.com/theforeman/puppet-foreman/pull/715) ([timogoebel](https://github.com/timogoebel))

## [11.0.1](https://github.com/theforeman/puppet-foreman/tree/11.0.1) (2019-04-02)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/11.0.0...11.0.1)

**Fixed bugs:**

- Fixup yaml facts prior to parsing in node.rb [\#714](https://github.com/theforeman/puppet-foreman/pull/714) ([alexjfisher](https://github.com/alexjfisher))

**Closed issues:**

- Locations and Organizations get turned on by default in 11.0.0 and authentication off [\#711](https://github.com/theforeman/puppet-foreman/issues/711)

**Merged pull requests:**

- Clarify the defaults switched [\#712](https://github.com/theforeman/puppet-foreman/pull/712) ([ekohl](https://github.com/ekohl))

## [11.0.0](https://github.com/theforeman/puppet-foreman/tree/11.0.0) (2019-01-14)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/10.0.0...11.0.0)
Expand All @@ -8,30 +43,27 @@

- Remove default repo management [\#708](https://github.com/theforeman/puppet-foreman/pull/708) ([ekohl](https://github.com/ekohl))
- Fixes [\#25787](https://projects.theforeman.org/issues/25787) - Make login and taxonomy settings optional [\#707](https://github.com/theforeman/puppet-foreman/pull/707) ([tbrisker](https://github.com/tbrisker))
- Fixes [\#25170](https://projects.theforeman.org/issues/25170) - Update admin/pass param to initial\_param. [\#701](https://github.com/theforeman/puppet-foreman/pull/701) ([chris1984](https://github.com/chris1984))
- Fixes [\#25170](https://projects.theforeman.org/issues/25170) - Prefix user params with initial\_ [\#701](https://github.com/theforeman/puppet-foreman/pull/701) ([chris1984](https://github.com/chris1984))

**Implemented enhancements:**

- allow puppetlabs-apache 4.x [\#709](https://github.com/theforeman/puppet-foreman/pull/709) ([mmoll](https://github.com/mmoll))
- Fixes [\#23054](https://projects.theforeman.org/issues/23054) - Refactor class inclusion [\#700](https://github.com/theforeman/puppet-foreman/pull/700) ([ekohl](https://github.com/ekohl))
- Declare Foreman group explicitly [\#697](https://github.com/theforeman/puppet-foreman/pull/697) ([ehelms](https://github.com/ehelms))
- Allow single node fact upload [\#692](https://github.com/theforeman/puppet-foreman/pull/692) ([ahmet2mir](https://github.com/ahmet2mir))
- Clean up acceptance tests + make the apt repo parameters [\#687](https://github.com/theforeman/puppet-foreman/pull/687) ([ekohl](https://github.com/ekohl))
- Add hammer plugin for foreman\_ansible [\#686](https://github.com/theforeman/puppet-foreman/pull/686) ([xprazak2](https://github.com/xprazak2))
- Reuse initialize\_http in external\_node\_v2 [\#683](https://github.com/theforeman/puppet-foreman/pull/683) ([ekohl](https://github.com/ekohl))
- Add Puppet 6 support [\#678](https://github.com/theforeman/puppet-foreman/pull/678) ([ekohl](https://github.com/ekohl))
- namespace extlib functions [\#675](https://github.com/theforeman/puppet-foreman/pull/675) ([mmoll](https://github.com/mmoll))

**Fixed bugs:**

- fix foreman config location for ssl = false and use\_vhost = false [\#705](https://github.com/theforeman/puppet-foreman/pull/705) ([Dimonyga](https://github.com/Dimonyga))
- Handle websockets\_encrypt as a boolean [\#702](https://github.com/theforeman/puppet-foreman/pull/702) ([ekohl](https://github.com/ekohl))
- Fix wrong variable name in enc function [\#694](https://github.com/theforeman/puppet-foreman/pull/694) ([ahmet2mir](https://github.com/ahmet2mir))
- Trying to fix rescue syntax in ENC script [\#685](https://github.com/theforeman/puppet-foreman/pull/685) ([qingbo](https://github.com/qingbo))

**Merged pull requests:**

- fix foreman config location for ssl = false and use\_vhost = false [\#705](https://github.com/theforeman/puppet-foreman/pull/705) ([Dimonyga](https://github.com/Dimonyga))
- Clean up acceptance tests + make the apt repo parameters [\#687](https://github.com/theforeman/puppet-foreman/pull/687) ([ekohl](https://github.com/ekohl))

## [10.0.0](https://github.com/theforeman/puppet-foreman/tree/10.0.0) (2018-10-18)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/9.2.0...10.0.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 4.6'
gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 5.5'

gem 'rake'
gem 'rspec', '~> 3.0'
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ previous stable release.

### Foreman version compatibility notes

Running without passenger is only supported on Foreman 1.22+.

The parameters `locations_enabled`, `organizations_enabled` and `authentication`
will only have any affect on Foreman 1.20 or older, in newer versions these
settings have been removed.
Expand All @@ -67,6 +69,15 @@ authentication.

For Foreman 1.16 or older, please use the 9.x release series of this module.

## Running without passenger

To use this module without passenger, the `passenger` parameter must be set to
`false`. This will install the `foreman-service` package and ensure the service
is running.

This introduces a soft dependency on `camptocamp-systemd`. This feature is only
available on Foreman 1.22+.

## Types and providers

`foreman_config_entry` can be used to manage settings in Foreman's database, as
Expand Down
18 changes: 17 additions & 1 deletion files/external_node_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,21 @@ class FactUploadError < StandardError; end
end
end

def empty_values_hash?(facts_file)
facts = File.read(facts_file)
puppet_facts = YAML::load(facts.gsub(/\!ruby\/object.*$/,''))

puppet_facts['values'].empty?
end

def process_host_facts(certname)
f = "#{puppetdir}/yaml/facts/#{certname}.yaml"
if File.size(f) != 0
if empty_values_hash?(f)
puts "Empty values hash in fact file #{f}, not uploading"
return 0
end

req = generate_fact_request(certname, f)
begin
upload_facts(certname, req) if req
Expand All @@ -115,6 +127,10 @@ def process_all_facts(http_requests)
certname = File.basename(f, ".yaml")
# Skip empty host fact yaml files
if File.size(f) != 0
if empty_values_hash?(f)
puts "Empty values hash in fact file #{f}, not uploading"
next
end
req = generate_fact_request(certname, f)
if http_requests
http_requests << [certname, req]
Expand Down Expand Up @@ -241,7 +257,7 @@ def upload_facts(certname, req)
if response.code.start_with?('2')
cache("#{certname}-push-facts", "Facts from this host were last pushed to #{uri} at #{Time.now}\n")
else
$stderr.puts "During the fact upload the server responded with: #{response.code} #{response.message}. Error is ignored and the execution continues."
$stderr.puts "#{certname}: During the fact upload the server responded with: #{response.code} #{response.message}. Error is ignored and the execution continues."
$stderr.puts response.body
end
end
Expand Down
16 changes: 9 additions & 7 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
ensure => absent,
}

file { $::foreman::init_config:
ensure => file,
content => template("foreman/${foreman::init_config_tmpl}.erb"),
if $::foreman::use_foreman_service {
systemd::dropin_file { 'installer.conf':
unit => "${::foreman::foreman_service}.service",
content => template('foreman/foreman.service-overrides.erb'),
}
}

file { $::foreman::app_root:
Expand Down Expand Up @@ -79,7 +81,7 @@
}

if $::foreman::passenger {
contain foreman::config::passenger
contain foreman::config::apache

if $::foreman::ipa_authentication {
unless 'ipa' in $facts and 'default_server' in $facts['ipa'] and 'default_realm' in $facts['ipa'] {
Expand Down Expand Up @@ -122,15 +124,15 @@
mode => '0600',
}

::foreman::config::passenger::fragment { 'intercept_form_submit':
foreman::config::apache::fragment { 'intercept_form_submit':
ssl_content => template('foreman/intercept_form_submit.conf.erb'),
}

::foreman::config::passenger::fragment { 'lookup_identity':
foreman::config::apache::fragment { 'lookup_identity':
ssl_content => template('foreman/lookup_identity.conf.erb'),
}

::foreman::config::passenger::fragment { 'auth_kerb':
foreman::config::apache::fragment { 'auth_kerb':
ssl_content => template('foreman/auth_kerb.conf.erb'),
}

Expand Down
Loading