Giter VIP home page Giter VIP logo

mkelfs's Introduction

mkelfs

mkelfs.py is a tiny python application for creating kickstart trees for EL-like distros (e.g. CentOS, Fedora, ScientificLinux,...).

Video

Creating Enterprise Linux kickstart trees with mkelfs

Usage

Usage: mkelfs.py [options]

mkelfs.py is used to create kickstartable distribution trees of EL-like
distros like CentOS, Fedora and ScientificLinux. Optionally you can also
create kickstart distributions on Spacewalk, Red Hat Satellite and SUSE
Manager. Login credentials are assigned using the following shell variables:
SATELLITE_LOGIN username         SATELLITE_PASSWORD password          It is
also possible to create an authfile (permissions 0600) for usage with this
script. The first line needs to contain the username, the second line should
consist of the appropriate password.         If you're not defining variables
or an authfile you will be prompted to enter your login information.
Checkout the GitHub page for updates: https://github.com/stdevel/mkelfs

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -r RELEASE, --release=RELEASE
                        define which release to use (e.g. 6.5)
  -x ARCH, --arch=ARCH  define which architecture to use (e.g. x86_64)
  -t DIR, --target=DIR  define where to store kickstart files. A subfolder
                        will be created automatically. (default:
                        /var/satellite/kickstart_tree)
  -m MIRROR, --mirror=MIRROR
                        define a valid EL mirror to use - DON'T add the
                        trailing slash! Have a loot at the EL mirror list
                        (e.g. http://www.centos.org/download/mirrors) for
                        alternatives
  -o DISTRO, --distro=DISTRO
                        defines for which distro the files are downloaded
                        (default: centos) - other possible values: fedora,
                        scientific
  -f, --force           defines whether pre-existing kickstart files shall be
                        overwritten
  -i, --ignore-existing
                        don't throw errors if downloaded files are already
                        existing (e.g. testing purposes
  -q, --quiet           don't print status messages to stdout
  -d, --debug           enable debugging outputs
  -c, --create-distribution
                        creates a kickstart distribution on the Spacewalk /
                        Red Hat Satellite or SUSE Manager server
  -b CHANNEL, --base-channel=CHANNEL
                        defines the name of the distro base-channel
  -a FILE, --authfile=FILE
                        defines an auth file to use instead of shell variables
  -s SERVER, --server=SERVER
                        defines the server to use

Examples

$ mkelfs.py --release 6.5 --arch x86_64 -c

downloads the latest kickstart files for CentOS 6.5 x86_64 to /var/satellite/kickstart_tree. The default mirror. A kickstart distribution is created afterwards (interactive login).

$ mkelfs.py --release 4.1 --arch i386 --target /var/museum/ks --mirror http://vault.centos.org

downloads the antiquated CentOS release 4.1 for i386 from the CentOS Vault mirror site. Files are stored in /var/museum/ks

$ mkelfs.py -r 6.4 -a x86_64 -o scientific -fq

downloads the Scientific Linux release 6.4 x86_64 from the default mirror. Pre-existing files are overwritten and no additional output is generated.

$ mkelfs.py -f -r 20 -a i386 -m http://mirror.digitalnova.at/fedora/linux -o fedora

downloads the 32-bit kickstart files for Fedora release 20 from a Austrian mirror.

Credits

Zordrak, thanks a lot for providing a bash script which inspired me to do this. Link to post: http://blog.tpa.me.uk/2013/12/10/creating-a-spacewalk-cobbler-kickstart-tree-for-centos/

Feedback

Feedback is always welcome - this is my first python script so feel free to help me optimizing it! :-)

mkelfs's People

Contributors

q-storm avatar stdevel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mkelfs's Issues

Downloading particular releases of CentOS 7 fails

Like reported in closed issue #13:

I figured out when you also use the minor Release number as 7.2.1511 the script is not downloading LiveOS folder. Could you also add this fix for Minor releases.

python mkelfs.py --release 7 --arch x86_64 -o centos -b CentOS 7 x86_64 --target /var/satellite/iso-images/
Is donwloading the LiveOS folder

python mkelfs.py --release 7.2.1511 --arch x86_64 -o centos -b CentOS 7 x86_64 --target /var/satellite/iso-images/
is downloading everything exept the LiveOS folder.

Print cobbler path after downloading kickstart files

It would be a nice improvement to see a filesystem path after downloading the kickstart files. Currently the path needs to be manually entered - depending on the distro (e.g.) you also need to add some folder to match the structure.

Script failes because of string lower() error

The script fails with the following message:
File "./mkelfs.py", line 90, in <module> options.arch = options.arch.lower() AttributeError: 'NoneType' object has no attribute 'lower'

Parameter for ignoring API support

Currently, I need to alter the toolkit after every new release of Spacewalk. It would useful to have a parameter to ignore API level validation as I might not find much time for maintaining this toolkit, anymore. :)

Invalid directory offset for ScienticLinux

When downloading kickstart files for ScientificLinux directory offsets are incorrect.

$ ls scientific-6.5-x86_64/* centos-6.5-x86_64/
centos-6.5-x86_64/:
images  isolinux  repodata

scientific-6.5-x86_64/os:
images

Add default mirrors for Fedora and Scientific Linux

It would be a good idea to add default mirrors for Fedora and Scientific Linux so that it is possible to simply download some releases from the default mirror. Currently this only works for CentOS.

Currently working:

# mkelfs.py -r 6.5 -a i386 -q

Idea to implement also things like:

# mkelfs.py -o scientific -r 6.1 -a x86_64 -q
# mkelfs.py -o fedora -r 20 -a x86_64 -fq

Fix folder structure for Fedora

Two additional folders for Fedora kickstart files needs to be stripped:

# ls /var/satellite/kickstart_tree/{cen*,fed*}
/var/satellite/kickstart_tree/centos-6.5-x86_64:
images  isolinux  repodata

/var/satellite/kickstart_tree/fedora-20-x86_64:
Fedora

spacewalk# ls /var/satellite/kickstart_tree/fedora-20-x86_64/Fedora/* -R
/var/satellite/kickstart_tree/fedora-20-x86_64/Fedora/x86_64:
os

/var/satellite/kickstart_tree/fedora-20-x86_64/Fedora/x86_64/os:
images  isolinux  repodata
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.