def test_oscodename(self): codename = Facter.get(OperatingSystemCodename) assert codename == 'trusty' assert type(codename) is OperatingSystemCodename
def test_osrelease(self): regex = OperatingSystemRelease.VERSION_RE rel = Facter.get(OperatingSystemRelease) assert rel is not None assert regex.match(rel) is not None
def test_osfamily(self): osfamily = Facter.get(OsFamily) assert osfamily is not OsFamily.Unknown assert osfamily is not None
def test_operatingsystem(self): os = Facter.get(OperatingSystem) assert os is not OperatingSystem.Unknown assert os is not None
def test_osrelease(self): rel = Facter.get(OperatingSystemRelease) assert rel is not None
def _collect_repo(self, collector): codename = Facter.get(OperatingSystemCodename) collector.collect_from_template( 'Puppet Platform Repository setup (Puppet OSS 5.x)', 'pc5x-repo.sh', dict(codename=codename))
from puppeter import container from puppeter.domain.model.configurer import CommandsCollector, Configurer from puppeter.domain.model.javafacts import JavaVersion from puppeter.persistence.service.commandscollector import CommandsCollectorImpl from puppeter.persistence.service.java import calculate_java_version from puppeter.persistence.service.os import calculate_operatingsystem, \ calculate_osfamily, calculate_osrelease, calculate_oscodename, calculate_docker from puppeter.domain.facter import Facter from puppeter.domain.model.osfacts import OperatingSystem, OsFamily, \ OperatingSystemRelease, OperatingSystemCodename, Docker from puppeter.persistence.service.puppetconf import PuppetConfConfigurer from puppeter.persistence.service.puppetserver import PuppetServerServiceStarterConfigurer, \ PuppetServerJvmArgsConfigurer Facter.set(OperatingSystem, calculate_operatingsystem) Facter.set(OsFamily, calculate_osfamily) Facter.set(OperatingSystemRelease, calculate_osrelease) Facter.set(OperatingSystemCodename, calculate_oscodename) Facter.set(Docker, calculate_docker) Facter.set(JavaVersion, calculate_java_version) container.bind(CommandsCollector, CommandsCollectorImpl) container.bind(Configurer, PuppetServerServiceStarterConfigurer) container.bind(Configurer, PuppetServerJvmArgsConfigurer) container.bind(Configurer, PuppetConfConfigurer)
def _collect_repo(self, collector): codename = Facter.get(OperatingSystemCodename) collector.collect_from_template( 'Puppet Labs Collection Repository (PC1) setup (Puppet OSS 4.x)', 'pc4x-repo.sh', dict(codename=codename))
def _collect_repo(self, collector): rel = Facter.get(OperatingSystemRelease) collector.collect_from_file( 'Ensure EPEL is active', 'ensure-epel-{rel}.sh'.format(rel=rel.major()))