# Install RPC portmapper service.
#
class portmap::server {

    case $operatingsystem {
        openbsd: {
            service { "portmap":
                ensure => running,
                enable => true,
            }
        }
        centos: {
            case $operatingsystemrelease {
                /^[1-5]\./: {
                    package { "portmap":
                        ensure => installed,
                    }
                    service { "portmap":
                        ensure  => running,
                        enable  => true,
                        require => Package["portmap"],
                    }
                }
                default: {
                    package { "rpcbind":
                        ensure => installed,
                    }
                    service { "rpcbind":
                        ensure  => running,
                        enable  => true,
                        require => Package["rpcbind"],
                    }
                }
            }
        }
        fedora: {
            package { "rpcbind":
                ensure => installed,
            }
            service { "rpcbind":
                ensure  => running,
                enable  => true,
                require => Package["rpcbind"],
            }
        }
    }

}
