Skip to content
Snippets Groups Projects
remctl.pp 1.9 KiB
Newer Older
# Configure a remctl server.
#
# The client installation is handled separately.
Adam Lewenberg's avatar
Adam Lewenberg committed

class base::remctl {
  package { 'remctl-server': ensure => installed }
Adam Lewenberg's avatar
Adam Lewenberg committed

  # Install the xinetd configuration.  Force a PATH setting since remctld
  # scripts may be assuming they have a sane PATH but xinetd may not have
  # any PATH set.
  base::xinetd::config { 'remctl':
    server      => '/usr/sbin/remctld',
    description => 'Remote authenticated command server',
    cps         => '100 5',
    env         => 'PATH=/sbin:/bin:/usr/sbin:/usr/bin',
  }

  # Switch RH boxes to 4373
  # TODO: remove this after the migration is complete and all systems are
  # on a modern enough branch to have picked up the change.
  if $::operatingsystem == 'redhat' {
    base::filter { '/etc/services':
      regex   => 'remctl[ \t]*4444/tcp',
      value   => 'remctl    4373/tcp',
      require => Package['remctl-server'],
      notify  => Service['xinetd'],
    }
  }

  # Our default iptables rules for remctl opens connections to all of
  # Stanford.  Allow the legacy port as well for the time being, although
  # we've mostly switched away from it now.
  base::iptables::rule { 'remctl':
    description => 'Allow remctl connections from all Stanford subnets',
    source      => [ '10.0.0.0/8',
                     '68.65.160.0/20',
                     '128.12.0.0/16',
                     '134.79.0.0/16',
                     '171.64.0.0/14',
                     '172.16.0.0/12',
                     '192.168.0.0/16',
                     '204.63.224.0/21' ],
    protocol    => 'tcp',
    port        => 4373,
  }

  # Ignore standard remctl log messages.   This doesn't ignore any of the
  # remctl commands, just messages from starting or stopping the generic
  # daemon and messages caused by port scans or common client errors.
  file { '/etc/filter-syslog/remctl':
    source => 'puppet:///modules/base/remctl/etc/filter-syslog/remctl',
  }