Project

General

Profile

« Previous | Next » 

Revision e09d3a7d

Added by Ewoud Kohl van Wijngaarden almost 11 years ago

Linting

View differences:

Gemfile
source "https://rubygems.org"
gem 'rake'
gem 'rspec'
gem 'rspec-puppet'
gem 'awesome_print'
puppetversion = ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : ['>= 2.6']
gem 'puppet', puppetversion
Rakefile
require 'rake'
require 'rspec/core/rake_task'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'awesome_print'
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"]
PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}'
PuppetLint.configuration.send("disable_class_inherits_from_params_class")
PuppetLint.configuration.send("disable_80chars")
task :default => [:spec, :lint]
manifests/config.pp
# Configure the foreman proxy
class foreman_proxy::config {
# Ensure SSL certs from the puppetmaster are available
......
ensure => present,
owner => 'root',
group => 'root',
mode => 0440,
mode => '0440',
content => "foreman-proxy ALL = NOPASSWD : ${foreman_proxy::puppetca_cmd} *, ${foreman_proxy::puppetrun_cmd} *
Defaults:foreman-proxy !requiretty\n",
require => File['/etc/sudoers.d'],
manifests/init.pp
# Install, configure and run a foreman proxy
class foreman_proxy (
$repo = $foreman_proxy::params::repo,
$custom_repo = $foreman_proxy::params::custom_repo,
manifests/install.pp
# Install the foreman proxy
class foreman_proxy::install {
if ! $foreman_proxy::custom_repo {
foreman::install::repos { 'foreman_proxy':
manifests/params.pp
# The default parameters for the foreman proxy
class foreman_proxy::params {
include tftp::params
......
$custom_repo = false
# variables
$port = "8443"
$port = '8443'
$dir = '/usr/share/foreman-proxy'
$user = 'foreman-proxy'
$log = '/var/log/foreman-proxy/proxy.log'
......
# If CA is specified, remote Foreman host will be verified
$ssl_ca = "${puppet_home}/ssl/certs/ca.pem"
# Used to communicate to Foreman
$ssl_cert = "${puppet_home}/ssl/certs/${fqdn}.pem"
$ssl_key = "${puppet_home}/ssl/private_keys/${fqdn}.pem"
$ssl_cert = "${puppet_home}/ssl/certs/${::fqdn}.pem"
$ssl_key = "${puppet_home}/ssl/private_keys/${::fqdn}.pem"
# Only hosts listed will be permitted, empty array to disable authorization
$trusted_hosts = []
manifests/proxydhcp.pp
# Configure the DHCP component
class foreman_proxy::proxydhcp {
$ip = inline_template("<%= scope.lookupvar('::ipaddress_${foreman_proxy::dhcp_interface}') %>")
$net = inline_template("<%= scope.lookupvar('::network_${foreman_proxy::dhcp_interface}') %>")
manifests/proxydns.pp
# Configure the DNS component
class foreman_proxy::proxydns {
class { dns:
class { 'dns':
forwarders => $foreman_proxy::dns_forwarders,
}
manifests/puppetca.pp
# Configure puppet CA component
class foreman_proxy::puppetca {
file { $foreman_proxy::autosign_location:
manifests/service.pp
# Set up the foreman service
class foreman_proxy::service {
service { 'foreman-proxy':
manifests/tftp.pp
# Set up the tftp component
class foreman_proxy::tftp {
include ::tftp
manifests/tftp/sync_file.pp
# Sync a TFTP file
define foreman_proxy::tftp::sync_file(
$source_path,
$target_path

Also available in: Unified diff