Esempio n. 1
0
 # there is a fix in libcdio (which provides iso-read) 0.92,
 # the remaining issue is you need to make sure you have libcdio 0.92 installed
 #
 #downloadedDistroIsoImage = ElIsoImage(ScriptUser.loggedIn.userHomeRelative \
 #                                      ("Downloads/SL-64-i386-2013-03-18-Install-DVD.iso"))
 downloadedDistroIsoImage = ElIsoImage(
     Download.fromUrl(
         "http://ftp.scientificlinux.org/linux/scientific/6.4/i386/iso/SL-64-i386-2013-03-18-Install-DVD.iso"
     ))
 # some possible choices pointed out
 # server w command line only
 kickstartFileContent = ElKickstartFileContent(
     ElKickstartTemplates.usableElKickstartTemplate001)
 kickstartFileContent.replaceRootpw(rootpw)
 kickstartFileContent.elReplaceHostname(exampleVm.basenameStem)
 kickstartFileContent.elReplaceStaticIP(ipaddress,
                                        nameservers=Nameserver.list)
 # put in DHCP at eth0, to be used with NAT, works well if before hostonly
 #kickstartFileContent.elReplaceStaticIP(ipaddress, nameservers=[])
 #kickstartFileContent.elAddNetworkConfigurationWithDhcp("eth0")
 # some possible modifications pointed out
 #kickstartFileContent.replaceAllPackages(ElKickstartTemplates.packagesOfSL64Minimal)
 #kickstartFileContent.removePackage("@office-suite")
 #kickstartFileContent.addPackage("httpd")
 # some other possible modifications pointed out
 #kickstartFileContent.replaceAllPackages(ElKickstartTemplates.packagesOfSL64MinimalDesktop)
 #kickstartFileContent.elActivateGraphicalLogin()
 for additionalUser in additionalUsers:
     kickstartFileContent.elAddUser(additionalUser[0],
                                    pwd=additionalUser[1])
 # some possible modifications pointed out
 #kickstartFileContent.setSwappiness(10)
Esempio n. 2
0
            "\n  echo 'vm.swappiness=" + swappiness + "' >> /etc/sysctl.conf"
            "\nfi"
            )
        # simply append
        # in case of multiple invocations last one would be effective
        postSection.string = postSection.string + settingSwappiness + "\n"
        return self

if __name__ == "__main__":
    from nrvr.distros.el.kickstart import ElKickstartFileContent
    from nrvr.distros.el.kickstarttemplates import ElKickstartTemplates
    _kickstartFileContent = ElKickstartFileContent(ElKickstartTemplates.usableElKickstartTemplate001)
    _kickstartFileContent.replaceLang("de_DE.UTF-8")
    _kickstartFileContent.replaceRootpw("redwood")
    _kickstartFileContent.elReplaceHostname("test-hostname-101")
    _kickstartFileContent.elReplaceStaticIP("10.123.45.67")
    _kickstartFileContent.addPackage("another-package-for-testing")
    _kickstartFileContent.addPackage("@another-package-group-for-testing")
    _kickstartFileContent.addPackage("@base")
    _kickstartFileContent.removePackage("@client-mgmt-tools")
    _kickstartFileContent.removeAllPackages()
    _kickstartFileContent.addPackage("made-something-up-for-testing")
    _kickstartFileContent.replaceAllPackages(["@package-group-1-for-testing",
                                             "@package-group-2-for-testing",
                                             "@package-group-3-for-testing",
                                             "package-a-for-testing",
                                             "package-b-for-testing",
                                             "package-c-for-testing"])
    _kickstartFileContent.elAddNetworkConfigurationWithDhcp("eth1")
    _kickstartFileContent.elAddNetworkConfigurationWithDhcp("eth0")
    _kickstartFileContent.elActivateGraphicalLogin()
 #
 # comment solely regarding .iso files larger than 4GB, e.g. x86_64 Install-DVD,
 # there had been issues that almost have gone away with a fixed newer version iso-read,
 # there is a fix in libcdio (which provides iso-read) 0.92,
 # the remaining issue is you need to make sure you have libcdio 0.92 installed
 #
 #downloadedDistroIsoImage = ElIsoImage(ScriptUser.loggedIn.userHomeRelative \
 #                                      ("Downloads/CentOS-6.6-i386-bin-DVD1.iso"))
 downloadedDistroIsoImage = ElIsoImage(Download.fromUrl
                                       ("http://mirrors.usc.edu/pub/linux/distributions/centos/6.6/isos/i386/CentOS-6.6-i386-bin-DVD1.iso"))
 # some possible choices pointed out
 # server w command line only
 kickstartFileContent = ElKickstartFileContent(ElKickstartTemplates.usableElKickstartTemplate001)
 kickstartFileContent.replaceRootpw(rootpw)
 kickstartFileContent.elReplaceHostname(exampleVm.basenameStem)
 kickstartFileContent.elReplaceStaticIP(ipaddress, nameservers=Nameserver.list)
 # put in DHCP at eth0, to be used with NAT, works well if before hostonly
 #kickstartFileContent.elReplaceStaticIP(ipaddress, nameservers=[])
 #kickstartFileContent.elAddNetworkConfigurationWithDhcp("eth0")
 # some possible modifications pointed out
 #kickstartFileContent.replaceAllPackages(ElKickstartTemplates.packagesOfSL64Minimal)
 #kickstartFileContent.removePackage("@office-suite")
 #kickstartFileContent.addPackage("httpd")
 # some other possible modifications pointed out
 #kickstartFileContent.replaceAllPackages(ElKickstartTemplates.packagesOfSL64MinimalDesktop)
 #kickstartFileContent.elActivateGraphicalLogin()
 for additionalUser in additionalUsers:
     kickstartFileContent.elAddUser(additionalUser[0], pwd=additionalUser[1])
 # some possible modifications pointed out
 #kickstartFileContent.setSwappiness(10)
 # pick right temporary directory, ideally same as VM
Esempio n. 4
0
            "\n  echo 'vm.swappiness=" + swappiness + "' >> /etc/sysctl.conf"
            "\nfi")
        # simply append
        # in case of multiple invocations last one would be effective
        postSection.string = postSection.string + settingSwappiness + "\n"


if __name__ == "__main__":
    from nrvr.distros.el.kickstart import ElKickstartFileContent
    from nrvr.distros.el.kickstarttemplates import ElKickstartTemplates
    _kickstartFileContent = ElKickstartFileContent(
        ElKickstartTemplates.usableElKickstartTemplate001)
    _kickstartFileContent.replaceLang("de_DE.UTF-8")
    _kickstartFileContent.replaceRootpw("redwood")
    _kickstartFileContent.elReplaceHostname("test-hostname-101")
    _kickstartFileContent.elReplaceStaticIP("10.123.45.67")
    _kickstartFileContent.addPackage("another-package-for-testing")
    _kickstartFileContent.addPackage("@another-package-group-for-testing")
    _kickstartFileContent.addPackage("@base")
    _kickstartFileContent.removePackage("@client-mgmt-tools")
    _kickstartFileContent.removeAllPackages()
    _kickstartFileContent.addPackage("made-something-up-for-testing")
    _kickstartFileContent.replaceAllPackages([
        "@package-group-1-for-testing", "@package-group-2-for-testing",
        "@package-group-3-for-testing", "package-a-for-testing",
        "package-b-for-testing", "package-c-for-testing"
    ])
    _kickstartFileContent.elAddNetworkConfigurationWithDhcp("eth1")
    _kickstartFileContent.elAddNetworkConfigurationWithDhcp("eth0")
    _kickstartFileContent.elActivateGraphicalLogin()
    _kickstartFileContent.elAddUser("jack", pwd="rainbow")