Commit Graph

1467 Commits

Author SHA1 Message Date
Adam Gandelman
441b30f89f Fallback to a boot_server kernel param if ip= not passed
Depending on bootloader and configuration, ramdisks may receive
a ip= kernel parameter that is used for manual network bring up
in the ramdisk.  This parameter contains the address of the boot
server.  In the absence of ip=, we want the ramdisk to DHCP and
proceed as normal.  However, in this case need to know the address
of the boot server.  This falls back to a 'boot_server' parameter
for this address if it is not provided via kernel cmdline.

Change-Id: Id1ed15ba125d91fa0a13d8e19d1385082ee5d9e9
Closes-bug: #1401289
Related-bug: #1401298
2014-12-10 15:36:15 -08:00
Jenkins
1273cd5532 Merge "Add some speedups to dpkg" 2014-12-10 19:45:34 +00:00
Monty Taylor
6be5c396d1 Add some speedups to dpkg
The docker build folks obsess about image size and speed a bit. Grab a
few of their optimizations from their debootstrap build process and
apply them to ours.

Change-Id: Ic3d3565423b0ae090896d99fd3bf1145eca6303d
2014-12-10 06:53:17 -08:00
Jenkins
1795682b6d Merge "Improve --ramdisk-element docs" 2014-12-10 05:44:58 +00:00
Jenkins
5de977e575 Merge "Migrate to new package-installs" 2014-12-10 05:44:45 +00:00
Jenkins
b74bb649e2 Merge "Allow injecting arbitrary yum repo configuration" 2014-12-09 18:56:08 +00:00
Ryan Brady
2fb72d6ed9 Deprecates username and password from boot time registration
The username and password combination is considered insecure to store in
the metadata passed to the stack as they can easily be obtained and
possibly used in an unathorized manner by logging into one of the
registration systems. The use of an activation key is more desirable
as it can only be used in conjunction with subscription-manager to
register a RHEL system.

This patch deprecates the username and password support from the script
that registers RHEL with either Satellite or RH Customer Portal during
boot-time.  This patch also adds a warning if the username and password
combination is used in the stack metadata. The documentation and examples
have also been updated to warn operators of the deprecation of username
and password.

This patch does not affect the username and password support for
registration activities while building images with diskimage-builder.

Change-Id: I05b7a18e910d31ad2273042409f8657ad9dee36a
2014-12-09 10:56:55 -05:00
Abel Lopez
fc862f460c Use env python
Change the shebang from /usr/bin/python to /usr/bin/env python
Some users, especially on older systems don't use the python
supplied with the OS. This has an impact with module loading if
the python in /usr/bin is 2.6, and user wants to use 2.7
in /usr/local/bin, for example

Change-Id: Ib31b369a94c33fb7508f0539c2b2f14177e507e0
2014-12-08 13:42:16 -08:00
Ryan Brady
386a7a01d3 Fix repo enablement for RHEL during registration
Previously the REG_REPOS value was a space delimited list of repo
names, but the spaces were incompatible with passing through json.
If you pass a list in json through the heat parameter, the output
is the string representation of a python list of unicode vaules.
This patch changes the rhel-registration scripts to process the
REG_REPOS value as a comma delimited list which is more easily
passed through json.  Both scripts have been updated to remain
consistent.

Change-Id: I21b3fd115e53aa3b0fa4af9bbfb1f08b6fe163ab
2014-12-04 21:52:16 -05:00
James Slagle
70880780f0 Allow injecting arbitrary yum repo configuration
Allows specifying the path to a yum repo configuration file to be used
during the image build process. The repo configuration file is removed
at the end of the build. This is useful in that it allows using any
arbitrary repo configuration during an image build.

Change-Id: I7d5c67d74a0bb4722ffc60aacfd9fa7e80fb59d5
2014-12-04 15:08:57 -05:00
Abel Lopez
acccfaf181 Don't use lsb_release
Using lsb_release to figure out what distro and release an image is
is redundant, as the same information is available in DIB_ vars.
Further, it causes errors when creating new rhel7/centos7 images
like this: http://paste.openstack.org/show/144729/

Change-Id: I213ee581b8abfe119ffe3b783e6a3236e58e3e47
2014-12-04 11:07:24 -08:00
Abel Lopez
563d334105 Fix rst rendering
The file extention claims rst format, but it's plain text
as such, the online documentation doesn't render properly

Change-Id: I24accb45ab8c7803a25f2642ce1b2d479d5a6e9c
2014-12-03 12:30:28 -08:00
Ryan Brady
bf8b77a8ea Add Activation Key Support For Customer Portal
This patch adds support to register with the hosted customer portal
using activation keys.  If an activation key is present in either
the REG_ACTIVATION_KEY or rh_registration.activation_key, it will
use that value instead of username and password credentials when
registering with Satellite or the hosted Customer Portal.  This
patch also enforces that an org must be set in either the REG_ORG
or rh_registration.org to use the activation key.

Change-Id: If40dd78ba793d508afb1a5ab345470ee5929afb0
2014-12-03 12:46:58 -05:00
Jenkins
f1c90ae72a Merge "Add element for hardware discovery ramdisk for ironic-discoverd" 2014-12-02 16:18:30 +00:00
Gregory Haynes
2626606980 Migrate to new package-installs
We have a new package-installs file format. Migrating existing
package-installs files to the new format.

Change-Id: I57d4a007efee9624e60c41357cefa627d8c7373f
2014-12-01 21:32:13 -08:00
Gregory Haynes
e5b8656141 Add new package-installs system
We currently support package-installs definitions which has some
limitations and oddities. This new format requires only one definition
which does not reside in our run-parts directories and follows a
consistent naming scheme (package-installs.yaml).

Change-Id: Ie51a7c4fdc15634ae8e069728e5e07cc1dc36095
2014-12-01 21:29:47 -08:00
Jenkins
ef8121141a Merge "Remove the grub2 install from redhat-common" 2014-12-02 02:54:48 +00:00
Jenkins
2d7885a984 Merge "Remove use of sudo from yum pre and post elements" 2014-12-01 17:26:22 +00:00
Ben Nemec
ff2a89215e Improve --ramdisk-element docs
Unlike most of the options to disk-image-create, this one didn't
document its default value, and it also didn't have any context for
why one might use it.

Change-Id: I57ea529cf387ab8ec8497d35be19ac64198df47a
Related-Bug: 1397073
2014-12-01 10:21:13 -06:00
Jenkins
407c824cbf Merge "disk-image-create: fix test when no argument is given." 2014-12-01 09:56:31 +00:00
Jenkins
c4ad904ee6 Merge "Unset requiretty if it exists in sudoers" 2014-11-28 19:13:42 +00:00
Monty Taylor
bec83686f4 Unset requiretty if it exists in sudoers
Fedora sets requiretty globally by default. This makes sense for
interactive machines with lots of password typing, but is pretty
attrocious for machines that might need users who remotely sudo to do
things. Just remove the setting.

Change-Id: Ic32bd92061a73f854683cc0d2d8919071dabe8cf
2014-11-28 11:35:00 -05:00
Monty Taylor
1b51e22f7d Remove the grub2 install from redhat-common
We immediately remove this, but the -grub2 causes a later attempt to
remove it again which fails. Don't install it in the first place.

Change-Id: I31d64abc9596707bdb8a0505d0dcbf7b82e1b82d
2014-11-28 11:01:40 -05:00
Monty Taylor
9cd5068854 Remove use of sudo from yum pre and post elements
sudo is not needed, since in-chroot elements are run in the context
of the root user. Furthermore, sudo in pre-install is problematic as
sudo may not have been installed yet (imagine a debootstrap build)

Change-Id: Ib5c7e176a90fe3b8fa9c3cd702d3d815df54f472
2014-11-28 11:01:40 -05:00
Dmitry Tantsur
13c6b6bdf1 Add element for hardware discovery ramdisk for ironic-discoverd
ironic-discoverd [1] is a StackForge project for conducting hardware properties
discovery via booting a special discovery ramdisk and interrogating hardware
from within it. It aims to be one of the official means of hardware properties
discovery for Ironic in Kilo release [2].

The ramdisk collects hardware information from the machine
it's booted on and posts it to the URL provided via
kernel argument 'discoverd_callback_url'.

[1] https://pypi.python.org/pypi/ironic-discoverd
[2] https://review.openstack.org/#/c/135605/

Co-Authored-By: Lucas Alvares Gomes <lucasagomes@gmail.com>
Change-Id: Ic81fe8b3bd0884971bb522b48658c7ee538a31f2
2014-11-27 10:51:44 +01:00
Jenkins
83c97e8129 Merge "Allow multiple identical sources" 2014-11-27 03:41:54 +00:00
Jenkins
37ec06cd0b Merge "Warning when using pypi element without a mirror" 2014-11-26 05:27:50 +00:00
Jenkins
ccf95e7857 Merge "Update RHEL Registration" 2014-11-25 22:17:52 +00:00
Frederic Lepied
ccd7811dc0 disk-image-create: fix test when no argument is given.
Avoid a warning when multiple arguments are passed to disk-image-create
like:

bin/disk-image-create: 146: [: aa: unexpected operator

Change-Id: I619d7bf2e4b56885d629019b80b249bc80b8f43e
2014-11-25 22:28:01 +01:00
Jenkins
9fae41c898 Merge "Fail helpfully if no elements are specified" 2014-11-25 12:29:06 +00:00
Ghe Rivero
91977e7c8f Warning when using pypi element without a mirror
Using only a local filesystem mirror could lead opaque errors.
Print a warning message in this situations.

Change-Id: I5f77151ea928868f4c441e8a1bb2eb0966b21832
Closes-Bug: #1297948
2014-11-25 11:41:11 +01:00
Jenkins
47b58526e7 Merge "Make some pkg-map errors soft" 2014-11-25 02:57:09 +00:00
Jenkins
3b0130ed79 Merge "Check python with flake8 instead of dib-lint" 2014-11-25 02:56:57 +00:00
Jenkins
019196ef7f Merge "Add deprecation warning when using map-services" 2014-11-22 14:48:33 +00:00
Gregory Haynes
b10cfa841a Make some pkg-map errors soft
An app using pkg-map (like package-installs) might want to distinguish
between a hard error (invalid pkg-map file) and a soft error (no
mapping found). Currently this is not possible because we only return
with error values of 1.

Also printing error messages to stderror so we can still make use of
stdout data during a soft error.

Change-Id: I8bef56d3a74e8530afb8c58ac50ca3e9f7700639
2014-11-21 12:49:49 -08:00
Gregory Haynes
9bb7ace03c Fail helpfully if no elements are specified
Instead of charging ahead and failing because we lack dib-run-parts we
can fail in this case with a useful error message.

Change-Id: Ie10176b5a7019a0385796984ebbaf7742876925a
2014-11-21 10:31:11 -08:00
Gregory Haynes
fd0708286c Check python with flake8 instead of dib-lint
We check python files with dib-lint rather than flake8 which have
conflicting opinions. This means weve been (forcibly) writing non pep8
python.

Also fixing pep8 issues so tests pass.

Change-Id: Idc9db40334f6e15738a7802c06697270df68741c
2014-11-21 09:04:52 -08:00
Jenkins
d8b156dedf Merge "Add DIB_DEBOOTSTRAP_EXTRA_ARGS environment variable" 2014-11-21 13:32:06 +00:00
Jenkins
d506c42ec4 Merge "Deprecate map-packages, replaced by pkg-map" 2014-11-20 01:41:45 +00:00
Ryan Brady
81b4c00fdc Update RHEL Registration
This patch updates the 00-rhel-registration script to not
not fail a stack when metadata isn't found.

Change-Id: Ie305fed79e4baadf1a03c4a3d06a23cf36e92f77
2014-11-19 18:05:24 -05:00
Jenkins
04e8ce0ece Merge "Enable RHEL Registration" 2014-11-19 22:34:37 +00:00
Jenkins
a80ff47dec Merge "Simplify Dracut cmdline script" 2014-11-19 20:26:10 +00:00
Ryan Brady
4178c0c69d Deprecate map-packages, replaced by pkg-map
This patch writes a warning out to stderr to notify element authors
that may be using map-packages to migrate to pkg-map.  This patch
also prints out a warning during image-create that lists the specific
elements that are not using pkg-map.

Change-Id: I7e2a7611dd5650815736ce998aa94a7833193d06
2014-11-19 12:04:12 -05:00
Jon-Paul Sullivan
8dd97597ea Allow multiple identical sources
The source-repositories element puts source in place in the generated image
for later installation.  It is possible for two elements to define the same
source to later install, and as long as the remote location and reference to be
installed is identical, we should not error.

Change-Id: Ic7dfb1961486c59d2005b5c1e7587267ea42e999
2014-11-19 12:03:16 +00:00
Tim Potter
018b1d4147 Add DIB_DEBOOTSTRAP_EXTRA_ARGS environment variable
This allows extra arguments to be passed to the debootstrap
command when creating an image using the debian element.

Change-Id: I87eb856365ff6a17f051e2e56587235648328d57
Co-Authored-By: Ghe Rivero <ghe.rivero@gmail.com>
2014-11-19 11:22:16 +00:00
Jenkins
8986283d41 Merge "Remove duplicate binary-deps from dracut-ramdisk" 2014-11-19 09:59:37 +00:00
Ghe Rivero
830de28e96 deploy-kexec depends on deploy
It was depending only on deploy-baremetal. Changing it to 'deploy' could
be used with both baremetal and ironic deployments

Change-Id: Ia2600080b488f7d259a9baf111767e82b6cc933d
2014-11-18 15:29:53 +01:00
Ben Nemec
8ee66ec8ec Remove duplicate binary-deps from dracut-ramdisk
These are already listed in the respective deploy-* elements, and
if we include them here then they get added to every ramdisk built
with dracut.  That causes issues for elements that don't need
something like tgtd because it won't be installed and the
binary deps script will fail.

Change-Id: Ibdcf7d200d4f7136396b63404cd966f7557043e0
2014-11-14 12:43:49 -06:00
Yuriy Zveryanskyy
676b1b738d Add element for building ramdisk with ironic-python-agent
This element creates kernel and ramdisk files based on Fedora,
example:
disk-image-create -a i386 -o test fedora ironic-agent disable-selinux

Change-Id: Ifa133d1680b81cb87d32a405aa7d7b40fe91f835
2014-11-13 19:30:44 +02:00
Jenkins
ce67ce87ea Merge "Support installing packages by default" 2014-11-13 10:27:56 +00:00