# the base class defining tings common for all three static classes (master, mirror, source)
class roles::static::base {
- ssh::keygen {'staticsync': }
- ssh::authorized_key_add { 'staticsync':
- target_user => 'staticsync',
- command => "/usr/local/bin/staticsync-ssh-wrap ${::fqdn}",
- key => $facts['staticsync_key'],
- restrict => 'no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-user-rc',
- collect_tag => 'staticsync',
- }
- ssh::authorized_key_collect { 'staticsync':
- target_user => 'staticsync',
- collect_tag => 'staticsync',
- }
-
file { '/etc/static-components.conf':
content => template('roles/static-mirroring/static-components.conf.erb'),
}
--- /dev/null
+# wrapper for ssh setup for statichosts
+class roles::static::ssh(
+ Variant[Array[String], String] $add_tag,
+ String $collect_tag,
+ )
+{
+ ssh::keygen {'staticsync': }
+
+ ssh::authorized_key_add { 'staticsync':
+ target_user => 'staticsync',
+ command => "/usr/local/bin/staticsync-ssh-wrap ${::fqdn}",
+ key => $facts['staticsync_key'],
+ restrict => 'no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-user-rc',
+ collect_tag => $add_tag,
+ }
+ ssh::authorized_key_collect { 'staticsync':
+ target_user => 'staticsync',
+ collect_tag => $collect_tag,
+ }
+}
include roles::static::base
include roles::static::srvdir
+ # masters need to talk to mirrors and sources
+ class { 'roles::static::ssh':
+ add_tag => [ 'staticsync-mirror', 'staticsync-source' ],
+ collect_tag => 'staticsync-master',
+ }
+
file { '/usr/local/bin/static-master-run':
source => 'puppet:///modules/roles/static-mirroring/static-master-run',
mode => '0555',
class roles::static_mirror {
include roles::static::base
include roles::static::srvdir
+
+ # mirrors talk only to masters
+ class { 'roles::static::ssh':
+ add_tag => 'staticsync-master',
+ collect_tag => 'staticsync-mirror',
+ }
+
include apache2::expires
include apache2::rewrite
# origin of static content. From here it goes to the static master before that one pushes it to the mirrors
class roles::static_source {
include roles::static::base
+
+ # sources talk only to masters
+ class { 'roles::static::ssh':
+ add_tag => 'staticsync-master',
+ collect_tag => 'staticsync-source',
+ }
}