Skip to content

Commit

Permalink
Contain classes
Browse files Browse the repository at this point in the history
This is the current way of containing classes
  • Loading branch information
ekohl committed Sep 26, 2018
1 parent 73f7fe6 commit 4144428
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
10 changes: 5 additions & 5 deletions manifests/agent.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Puppet agent
class puppet::agent {
class { '::puppet::agent::install': }
-> class { '::puppet::agent::config': }
~> class { '::puppet::agent::service': }
-> Class['::puppet::agent']
contain puppet::agent::install
contain puppet::agent::config
contain puppet::agent::service

Class['puppet::config'] ~> Class['puppet::agent::service']
Class['puppet::agent::install'] ~> Class['puppet::agent::config']
Class['puppet::config', 'puppet::agent::config'] ~> Class['puppet::agent::service']
}
9 changes: 3 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -736,17 +736,14 @@
Array[String] $server_puppetserver_trusted_agents = $puppet::params::server_puppetserver_trusted_agents,
Optional[Enum['off', 'jit', 'force']] $server_compile_mode = $puppet::params::server_compile_mode,
) inherits puppet::params {
include ::puppet::config
Class['puppet::config'] -> Class['puppet']
contain puppet::config

if $agent == true {
include ::puppet::agent
Class['puppet::agent'] -> Class['puppet']
contain puppet::agent
}

if $server == true {
include ::puppet::server
Class['puppet::server'] -> Class['puppet']
contain puppet::server
}

# Ensure the server is running before the agent needs it, and that
Expand Down
12 changes: 7 additions & 5 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -498,16 +498,18 @@
$rack_service = false
}

class { '::puppet::server::install': }
~> class { '::puppet::server::config': }
~> class { '::puppet::server::service':
class { 'puppet::server::service':
app_root => $app_root,
httpd_service => $httpd_service,
puppetmaster => $pm_service,
puppetserver => $ps_service,
rack => $rack_service,
}
-> Class['puppet::server']

Class['puppet::config'] ~> Class['puppet::server::service']
contain puppet::server::install
contain puppet::server::config
contain puppet::server::service

Class['puppet::server::install'] ~> Class['puppet::server::config']
Class['puppet::config', 'puppet::server::config'] ~> Class['puppet::server::service']
}

0 comments on commit 4144428

Please sign in to comment.