Commit Graph

1137 Commits

Author SHA1 Message Date
Jenkins
241b3155c0 Merge "Fallback to a boot_server kernel param if ip= not passed" 2015-01-21 08:56:55 +00:00
Jenkins
1162a3abe1 Merge "Fix Satellite Repo" 2015-01-20 17:55:59 +00:00
Jenkins
85c7a91666 Merge "Disable all interfaces on eni systems" 2015-01-20 00:40:22 +00:00
Cédric Ollivier
be95738739 Set http_proxy to retrieve the signed Release file
This commit adds http_proxy=$http_proxy to use apt-get update through a
http-proxy.

Change-Id: Iee589f6d11b84991512493d22f0e3dbfe60736ec
Closes-Bug: #1412314
2015-01-19 07:16:43 +01:00
Ryan Brady
c9af576e79 Run Registration Once
The rhel-common element has a script that uses subscription-manager
to register an instance of RHEL with the customer portal or Satellite.
If os-refresh-config runs this script more than once,
subscription-manager returns a non-zero value causing os-refresh-config
to fail.  Adding --force to the subscription-manager calls doesn't
properly unregister the image from Satellite and the result is multiple
content host registrations. This patch changes the registration to only
run once.

Change-Id: If372e7f59bbdc77e2b233024c1342f005004f2e5
2015-01-16 21:55:59 +00:00
Ryan Brady
297c734424 Fix Satellite Repo
Previous to the Sattelite 6 release, the katello-agent and it's
dependencies needed the rhel-7-server-rh-common-beta-rpms repo
enabled.  Since the the release of Satellite 6, the "beta" can
be safely dropped.  This fixes an error where registration to a
satellite instance fails due to a 404 for the beta repo.

Change-Id: Ia9879498c7db0c912bb58ea084d448b8b3915569
2015-01-16 16:52:11 -05:00
Clark Boylan
bab9595524 Use DIB_IMAGE_CACHE in dpkg element
The dpkg element was hardcoding ~/.cache/image-create as the cache path,
but elements should use DIB_IMAGE_CACHE as the root for the cache to
allow users to override the path. Replace the hardcoded path with one
that is rooted at $DIB_IMAGE_CACHE.

Change-Id: I76030654e7dfc7b7d4dfa87e082c14e7cee479b9
2015-01-13 14:22:10 -08:00
Jenkins
af4b290328 Merge "Fix for RHEL6" 2015-01-12 16:22:18 +00:00
Jenkins
bc4880fb91 Merge "Allow for disabling rhel registration" 2015-01-09 18:31:30 +00:00
Jenkins
2951b04cf7 Merge "Add rax-nova-agent element" 2015-01-09 18:28:07 +00:00
Jenkins
84463cf8da Merge "Add element for ubuntu-core" 2015-01-09 18:27:52 +00:00
Jenkins
89e9c01cd4 Merge "Deprecates username and password from boot time registration" 2015-01-09 15:17:57 +00:00
Jenkins
e304882e9d Merge "Fix repo enablement for RHEL during registration" 2015-01-09 15:17:43 +00:00
Jenkins
86edbd86fa Merge "dracut-ramdisk: fix support for elements with ramdisk-install.d" 2015-01-08 04:22:34 +00:00
Ryan Brady
d669d78528 Fix for RHEL6
The correct workflow for building RHEL6 images includes not using
the rhel-registration scripts in this element, but rather the 00-rhsm
script.  This patch updates the return value from 1 to 0 for the case
when the REG_METHOD is left unset.  This will allow the RHEL6 images
to build without needing to set REG_METHOD. This patch also improves
the note about RHEL6 image building.

This patch is the result of the discussion in the comments of [1].

[1] Iff7b9fc30d5a36231598a977a9edcd55229766c5

Change-Id: I2f35b8d7d8749d44d88f06e9e2c3116ff93b88fe
Closes-Bug: 1404364
2015-01-07 10:27:55 -05:00
James Slagle
697800987f Allow for disabling rhel registration
When using the rhel element, it can be uesful to disable registration.
For instance, if using an internal mirror repository that does not
require registration/authentication.

Change-Id: I42fa34e7f146137e5b1b9c5d7785702311e1dca1
2015-01-07 10:27:48 -05:00
Jenkins
c597e99f4e Merge "Ignore stderr from pkg-map" 2015-01-06 21:20:18 +00:00
Jenkins
ef0c043c85 Merge "Add Activation Key Support For Customer Portal" 2015-01-06 18:04:12 +00:00
Jenkins
76f5f199cb Merge "Don't trace RHEL registration scripts" 2015-01-02 18:37:22 +00:00
Jenkins
ebe166448f Merge "Allow absolute path to image with ironic-agent" 2014-12-23 23:08:50 +00:00
Erwan Velu
75b34baa98 dracut-ramdisk: fix support for elements with ramdisk-install.d
Copy all of TMP_MOUNT_PATH into the ramdisk so that
ramdisk-install.d actions are respected.

Includes a workaround for a bug in Dracut that caused the copy
to fail.

Also moves init instead of copying it so we don't conflict with
the Dracut init.

Change-Id: Ia8d7b210369fe7eb7ab239cbdb7f96841104a35d
Closes-Bug: 1403121
2014-12-18 11:46:49 +01:00
Ben Nemec
68394e134e Don't trace RHEL registration scripts
These scripts are littered with references to passwords and keys,
so rather than try to disable tracing in every one of those places
I propose we simply turn it off for the scripts.  This will likely
need to be revisited after the global tracing discussion is
resolved anyway.

Change-Id: I805015300bf01b2f8eec9f70ccfdf533dd9386b3
Related-Bug: 1298205
2014-12-17 16:39:27 -06:00
Abel Lopez
da7787069d Ignore stderr from pkg-map
The latest update to package-install captures both stderr and stdout
from pkg-map, unfortunately, pkg-map has a 'missing-ok' option
which causes it to print an error message on stderr.
The result is that package-install tries to look for packages named
"Missing", "package", "name", etc.

Change-Id: I86b3b71a64b29d533b42fd0cae020e8ecf22cac2
Closes-bug: 1402085
2014-12-17 10:08:08 -08:00
Clint Byrum
4dceacd5ed Allow absolute path to image with ironic-agent
The element was prepending the work directory forcibly, which will have
problems when the image name has an absolute path, which is allowed.

Change-Id: I0cb7b96e24daab8ee73611936af72074c70ac1aa
Closes-Bug: #1400405
2014-12-16 10:40:55 -08:00
Yuriy Zveryanskyy
26e2ec6faa Add install section to Ironic agent systemd service file
"Install" section is necessary for for "systemctl enable" command.

Change-Id: I590ac3a1b58a80e156967dd2787a1ba88e8a6fd5
2014-12-16 18:53:45 +02:00
Jenkins
9a53631e1c Merge "Fix rst rendering" 2014-12-16 13:51:59 +00:00
Monty Taylor
a281cca038 Add element for ubuntu-core
Ubuntu has recently release their "Snappy Ubuntu Core" which is a
minimal base-layer for running docker applications. Seems like the sort
of thing someone might want to use for tasks.

Change-Id: I6cb724451d1862121dee4ccf1f599ab8938f0b7f
2014-12-11 18:04:58 -08:00
Monty Taylor
cd3dfe7395 Add rax-nova-agent element
VMs on Rackspace Cloud need nova-agent installed to get networking
information set up properly. Add a nova-agent element so that dib can
be used to create images to use on Rackspace cloud.

Change-Id: I075a50e9a2d7ae7641905b66bbbc627ad708b5ea
2014-12-11 18:04:26 -08:00
Monty Taylor
af2862a2be Add minimal ubuntu and centos base elements
There are times when a much more stripped down base image is desired
over the distro cloud images. For instance, Infra would like some base
images that do not have cloud-init or really much of anything else. This
is easy to accomplish with debootstrap and rinse.

Change-Id: I44ff22457165afb048fdaea469210ae47d83dd3f
2014-12-11 13:27:36 -08:00
Monty Taylor
98d008c6af Rework package-installs to collapse on build host
Instead of doing the work in the image of parsing through the element's
package-install declarations, we can squash it on hostside, where we
have both YAML and JSON available to us, and then emit a single
pre-processed file into the target to be used later.

Change-Id: I3f182aa3aae0a79b2f3ea4e66c1878ad12878b0a
2014-12-11 00:05:32 -08:00
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
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
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
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
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
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
Ben Nemec
f528aa316e Simplify Dracut cmdline script
We don't actually need a real value for the root kernel param, and
requiring one causes problems for things like the discovery ramdisk
that don't pass in a disk= parameter.  Dracut seems to be happy to
take /dev/zero as the value, so we can just always use that.

Change-Id: Ia724f0214c26aa18c6f8f41f2c48d7f25b52ee6c
2014-11-12 11:18:53 -06:00
Ryan Brady
1aecb41b7e Add deprecation warning when using map-services
This patch writes a warning out to stderr to notify element authors
that may be using map-services to migrate to svc-map.

Change-Id: Ic80db16c607958d025e89b3a4058a9cbb568938e
2014-11-12 17:03:49 +00:00
Derek Higgins
c26a9ee4b1 Install lsb_release from package
The URL we were using to download lsb_release from no longer works,
install from package so this is not affected by disappearing URL's
in future.

This was originally installed from a URL because the package dependencies
caused a 87M increase in the size of the base image. For fedora the
increase is now 27M which is a little more tolerable.

Change-Id: I6e56a4a81786b33c5c6b92df2bd8236cd3f19670
2014-11-10 11:28:49 +00:00
Ryan Brady
ac8514c089 Enable RHEL Registration
This patch documents the 00-rhsm script as <= RHEL6 as it doesn't
work with the latest release of Satellite.  The Red Hat Network
(RHN) method of registration is being phased out in favor of Red
Hat Customer Portal and Satellite 6.  The subscription-manager
command line tool is the preferred method of registration.

The registration of RHEL is required to enable repositories for
software installation during image creation time.

This element provides functionality for registering RHEL images
during the image build process with diskimage-builder's
disk-image-create script.  The RHEL image will register itself
with either the hosted Red Hat Customer Portal or Satellite to
enable software installation from official repositories. After
the end of the image creation process, the image will unregister
itself so an entitlement will not be decremented from the account.

Boot-time registration is supported through metadata.  Please see
the configuration in the README for more information.

Change-Id: Ia9ef377cc4ed9595633888bfb248a1224e04b542
2014-10-31 12:36:43 -04:00
Jenkins
cafad0a148 Merge "Update Debian repo to retrieve signed Release file" 2014-10-31 01:27:19 +00:00
Jenkins
d72435a86b Merge "Optimize speed of deletion in find command" 2014-10-30 12:53:28 +00:00
Jenkins
50085793cc Merge "Unset trap before dracut ramdisk build script exits" 2014-10-30 11:43:09 +00:00
Jenkins
1e5ec9adb3 Merge "Use binary-deps.d for dracut ramdisks" 2014-10-30 06:25:30 +00:00
Dan Prince
022cb2c1c2 Support installing packages by default
Adds new disk-image-create --install-type option which
can be used to enable alternate install types. The
default install type is 'source'.

The motivation is to eliminate elements like
enable-package-installs which require coupling and also
don't work with elements in multiple element repositories.

This patch does not prevent you from using the previous
DIB_INSTALLTYPE_ variables to customize the install type,
rather it just changes the default so you don't have to
set it so often when using things like packages.

Change-Id: Icee98440fc2251728f2dca30e7c4789a0fd89b93
2014-10-28 15:05:53 -04:00
AzherKhan
bb38d0e325 Optimize speed of deletion in find command
I would like to recommend to use + instead of \; in the find
command. As this will ensure the removal of all selected
directories in a single invocation.

Hence improve the speed of deletion.

Change-Id: I409fe11aae217afb6f790491591005c679264ed4
2014-10-27 21:04:09 -07:00
Jenkins
dbe2846264 Merge "package-installs assumes packages have a pkg-map" 2014-10-28 00:15:19 +00:00
Gregory Haynes
c27e32f769 package-installs assumes packages have a pkg-map
Our package-installs script fails when installing a package which does
not have a pkg-map but a pkg-map file exist for the element.

Change-Id: I3dab802e23bccfc916efcc1c70c6ce6c4a9ccf67
2014-10-27 09:42:58 -07:00
Jenkins
3c8cf6a724 Merge "Move busybox binary-dep to ramdisk element" 2014-10-27 08:30:48 +00:00
Jenkins
34c273d8df Merge "Make diskimage-builder work in Docker." 2014-10-24 20:13:45 +00:00
Jenkins
2d80e53186 Merge "iso element to use 'search --label' for grub" 2014-10-24 15:55:44 +00:00
Jenkins
9d252ba318 Merge "Handle extra spaces in merge-svc-map-files" 2014-10-24 07:42:02 +00:00
Ben Nemec
0db6b9b401 Unset trap before dracut ramdisk build script exits
A similar change was needed in the normal ramdisk element as part
of ae928057bd to avoid running
cleanup immediately after the ramdisk build completes.

Change-Id: Ia96e2d8011b88ed96cc6727914c5a5d2dea59757
2014-10-23 20:02:08 -05:00
Ramakrishnan G
8c9ee78ab5 iso element to use 'search --label' for grub
Current iso element uses 'search --file' to find the
grub root.  This is a wrong approach as it may find
some other partition containing /vmlinuz. Instead modify
it to search for grub root by the label of ISO image.

Closes-Bug: 1384826
Change-Id: Id4217be3420597bed2f80a96788928259ec91582
2014-10-23 23:04:17 +05:30
Ghe Rivero
4543294487 Update Debian repo to retrieve signed Release file
After bootstraping a Debian image, the repository keys
are installed to verify the packages signatures, but the
Release signature file is missing. Updating the repo,
will retrieve a new InRelease file (inline signed).

Change-Id: I14f0d22cc9c72be9b07f3708270359bc8cff112d
2014-10-23 07:38:31 +00:00
Jenkins
1e55938148 Merge "iso element to build bootable ISO images" 2014-10-23 06:05:34 +00:00
Ben Nemec
bb8126e887 Use binary-deps.d for dracut ramdisks
Instead of hard-coding a list of binaries to include in the dracut
ramdisk, use the existing binary-deps.d functionality to provide a
list.  This will allow other ramdisks (such as discovery) to add
the binaries they need.

Change-Id: Ib7ffa15e08db1cc45e93a8f2a5c01369772c93ff
2014-10-22 15:13:48 -05:00
Jenkins
2337532954 Merge "svc-map requires PyYAML" 2014-10-22 08:15:54 +00:00
Jenkins
602ec41dd7 Merge "Revert "introduce $SYSTEMD_SYSTEM_UNIT_DIR"" 2014-10-21 21:15:25 +00:00
Ben Nemec
088f0eb7ac Move busybox binary-dep to ramdisk element
Busybox should be installed and managed from the ramdisk element,
since that is common to all elements that need busybox.  In
addition, we do not want busybox installed when building Dracut
ramdisks, so it can't be in the deploy-* elements.

Change-Id: I2656d20b466138f7f6dfcf558ba90c6909151d3c
2014-10-21 16:05:19 -05:00
James Slagle
ccd292c10a svc-map requires PyYAML
svc-map requires PyYAML, so install it. It's not always installed on all base
images.

Change-Id: I7ce5325e8afa0047f67153baa1fc7d4a90196c88
2014-10-21 16:13:16 -04:00
Ramakrishnan G
13aed64e97 iso element to build bootable ISO images
This commit adds a new element named 'iso' to build a bootable
ISO image for the kernel/ramdisk emitted by the 'baremetal' or
'ramdisk' element.

Change-Id: I89d175a29e2d0bc64b47fe527f0d0f6875f6849a
2014-10-21 14:37:57 +05:30
Michael Kerrin
730e7bd76e Handle extra spaces in merge-svc-map-files
During internal testing we are getting the following error from
merge-svc-map-files
File "/tmp/image.K2MYCphY/hooks/extra-data.d/10-merge-svc-map-files", line 54, in main
    with open(data_path, 'r') as dataFile:
IOError: [Errno 21] Is a directory: '...diskimage-builder/elements/svc-map'

Somehow IMAGE_ELEMENT contains a extra white space that manifests itself
as an element without a name. It is very hard to find where this is coming from so
instead this patch makes merge-svc-map-files more robost to this situation

Change-Id: Id1500ead8a77d691408617dcdc4e095bc5775be8
2014-10-20 18:16:39 +01:00
Jenkins
8ba6a26e0a Merge "Allow source-repositories to be disabled completely" 2014-10-20 11:35:40 +00:00
Jenkins
bb07de7fe9 Merge "Enable dracut deploy ramdisks" 2014-10-20 11:03:54 +00:00
Ben Nemec
eed30adc48 Enable dracut deploy ramdisks
The element builds dracut from source on Ubuntu because the
Ubuntu dracut package is broken and very old, so it can't be
installed properly and causes a number of other issues that
are fixed by using a newer version of Dracut.

This initial version should work in virtualized environments.
Further validation of its suitability for real baremetal
deployments will need to be done in the future, but this should
be sufficient to enable that work.

Regarding Dracut specifically, in order to limit the changes
needed in the existing scripts this element continues to use a
cut down version of the /init script that we were building for the
existing ramdisk.  However, instead of running it as pid 0 it is
run as a Dracut pre-mount hook.  This allows Dracut to set up all
of the hardware and system bits, while falling early enough in the
Dracut sequence to complete the deployment before Dracut would try
to boot off the hard disk.

bp tripleo-juno-dracut-ramdisks
Change-Id: I144c8993fe040169f440bd4f7a428fdbe3d745cf
2014-10-17 21:44:09 -05:00
Gonéri Le Bouder
a9006ee1e7 Revert "introduce $SYSTEMD_SYSTEM_UNIT_DIR"
This reverts commit 4bf38a829a.

This variable is pointless since we can always replace it with
/lib/systemd.

Commit I459f7514ab35082d31607968252a9005fa25de2a will fix the issue
in tripleo-image-elements.

Change-Id: I524badb6836a0d04a5f6e6a5b5d95920fd923ef6
2014-10-17 10:29:34 +02:00
Jenkins
2b60bea961 Merge "Allow for multiple image outputs from raw source" 2014-10-16 21:56:28 +00:00
Jenkins
e289b31d12 Merge "Consolidate lsb_release source-repositories" 2014-10-16 21:14:05 +00:00
Jenkins
5b71da8899 Merge "Remove first-boot.d support" 2014-10-16 18:36:59 +00:00
Jenkins
4ec80ee1f0 Merge "Don't re-install cloud-init for centos7 images" 2014-10-16 17:39:20 +00:00
Ghe Rivero
0b86194216 Disable all interfaces on eni systems
We are autodetecting and configuring devices in dhcp-all-interfaces
so having one configured in /etc/network/interfaces by default
is redundant and slows boot down.

Change-Id: Ic4e8a0668c793d21ed2dd96908649c9a77264f67
Closes-Bug: #1239480
2014-10-16 12:27:22 +00:00
Ghe Rivero
873de01491 Remove first-boot.d support
After being deprecated two releases ago, finally remove any reference
for the support of first-boot.d

Change-Id: I08d67404ef48cad61db3b18fb86e970abfa5d2b6
2014-10-16 09:48:14 +00:00
Ben Nemec
0eccd2808c Allow source-repositories to be disabled completely
In our official image builds we are only allowed to use resources
that are "blessed" by the build system.  This means that external
things like git repos and tar files are not allowed.  Currently,
even in offline mode source-repositories expects those things to
be available in the cache, so we need a way to disable it entirely.

This change adds an environment variable NO_SOURCE_REPOSITORIES
that does so.  It can be set in an environment.d script so elements
that might rely on a source repository will know it's not available.
The 02-lsb script in redhat-common is one such example and is
updated to handle this case.

Change-Id: I0de63bee6ad79733d6711478c707a9b41593e85f
2014-10-15 12:24:50 -04:00
Ian Wienand
97678dcda5 Move to final release of CentOS7 images
This is the final released image; it is the same one deployed in many
cloud provers such as HP and AWS.  It is also safe from all known
vulnerabilities up to its release

Change-Id: Ib8ba561662d2a98da55eb292b850dc019226dd59
2014-10-15 15:35:51 +11:00
Ben Nemec
0d08925892 Consolidate lsb_release source-repositories
Each distro had its own copy of the file, but they were all the
same and it's actually installed in redhat-common so it belongs
there.

Change-Id: Iad15f39fd28d1c4e20d30dcb2eb0ae6f2fa2b015
2014-10-14 15:09:44 -05:00
Clark Boylan
ae928057bd Allow for multiple image outputs from raw source
When uploading images to multiple clouds it is possible that the same
image will be needed in multiple formats to accomodate hypervisors
across clouds. Update disk-image-create's -t flag to take a list of
desired output image formats so that a single disk-image-create can
output all of the desired image formats.

Change-Id: If121b2342ae888855ba435aa3189f039e985b812
2014-10-13 09:16:42 -07:00
Ian Wienand
83656127da Don't re-install cloud-init for centos7 images
The centos7 images come with the base version of cloud-init already
installed.

---
$ virt-inspector CentOS-7-x86_64-GenericCloud-GA-7.0.1406_01.qcow2
...
      <application>
        <name>cloud-init</name>
        <version>0.7.5</version>
        <release>10.el7.centos.1</release>
        <arch>x86_64</arch>
      </application>
...
---

I think this is a hang-over from early rhel7 images that didn't have
it.

Change-Id: Idf488942222d9e6bca4d66f04f5af42e6707944d
2014-10-10 15:52:26 +11:00
Jenkins
4b05499384 Merge "Move install bin from rpm-distro to yum" 2014-10-10 01:20:51 +00:00
Ben Nemec
e5a2e07301 Check for epel before installing it
instack runs this script on a system where epel has already been
installed, which causes the yum command to fail.  Only installing
the epel-release rpm when it isn't already present addresses the
issue.

Change-Id: Ia179d7c7ed69ea5f785b5dcd16394c7663a145cc
2014-10-09 13:00:12 -05:00
Jenkins
3180c63338 Merge "Ensure epel7 is installed only on rhel7/centos7" 2014-10-08 14:00:12 +00:00
Ghe Rivero
6484b9b026 Move install bin from rpm-distro to yum
rpm-distro element was trying to install bin programs into the
image but it doesn't provide any. Move that logic into the yum
element which provides the install-packages bin.

Change-Id: Id5339fc7ffbef6327fe41f50a3e39ab30b6d0320
2014-10-08 07:43:19 +00:00
Jenkins
0f7d9af998 Merge "Move dpkg manifest creation to finalise" 2014-10-07 01:21:28 +00:00
Jenkins
927f437cd0 Merge "Save extended attributes when creating tar" 2014-10-07 01:16:33 +00:00
Jenkins
a9086da83f Merge "Fix openSUSE cloud image download and extraction" 2014-10-06 13:25:05 +00:00
Monty Taylor
3acc866f6d Use DIB_IMAGE_CACHE everywhere
disk-image-create processes a DIB_IMAGE_CACHE variable and exports it,
but there are several elements that ignore the value and wrote out
the base location themselves. Use the variable everywhere so that it
will get overridden everywhere.

Change-Id: I00fff354d6c931ad67cf3052d055f0e4604dfdc8
2014-10-05 13:58:32 -07:00
Ben Nemec
edd7477891 Save extended attributes when creating tar
The way redhat-common's extract-image script was creating the base
tarball caused file capabilities to get dropped, which meant that
things like ping in RHEL 7 images was unusable for regular users.
This change adds the necessary options to the tar call to maintain
as many extended attributes as possible.

--acls and --selinux are intentionally omitted, and the selinux
xattrs are filtered out because all of those items cause issues
in our chroot environment.  We restore selinux attributes at the
end of the build anyway so that shouldn't be a problem.

bz reference: https://bugzilla.redhat.com/show_bug.cgi?id=1144149

Change-Id: Ibff99ce9bde01bc5ecf95dc3a5d3e2cebe5015b9
2014-10-03 23:05:17 -05:00
Jenkins
07f11be024 Merge "Install openstack-selinux on RHEL" 2014-10-03 12:44:46 +00:00
Jenkins
a31bae8f60 Merge "Add unit test for cache-url" 2014-10-02 20:28:28 +00:00
Giulio Fidente
ee001cf4bd Ensure epel7 is installed only on rhel7/centos7
Change-Id: I5812812f7d2cb5ba2e310e33d6e01cda8823c1c4
2014-10-02 12:14:25 +02:00
Jenkins
42e79c4a6e Merge "Fix $DISTRO_NAME usage for centos7 element" 2014-10-02 10:10:04 +00:00
Richard Su
c1d4cd13e9 Update EPEL release rpm
EPEL 7 was released September 30. The beta release rpm was removed
from the repo and was replaced with the final release rpm.

Change-Id: I103a2f7abd7563869b9e39ccc1fbb3cfbd9ff6ae
2014-10-01 22:26:18 -07:00
Ryan Brady
c8037cc73f Fix $DISTRO_NAME usage for centos7 element
In both of the changed files in this patch, the $DISTRO_NAME usage
is checking against "centos".  The valid value for the centos7
element for $DISTRO_NAME is "centos7"[1].

[1] http://git.io/8IvuTw

Change-Id: I0c4a4b2ecf87c7a9283d10071f6feb494a6c716a
2014-10-01 21:42:47 -04:00
Ben Nemec
58d6c6478a Add unit test for cache-url
A sanity check that cache-url does the right thing when presented
with the appropriate curl return codes.  This change brings in the
test code for scripts from tripleo-image-elements, which needs to
be factored out into a place both projects can use it.

I'm stubbing out curl so we don't have a dep on curl in our unit
tests, and because I've seen some strange behavior out of curl in
the gate that caused random failures in this test.

Change-Id: I31e6b06b45415feec7285511d07e65eb78d0d045
2014-09-30 16:39:21 -05:00
Richard Su
8baf819b08 Install openstack-selinux on RHEL
The openstack-selinux package contains policy updates for OpenStack.
Updates are accrued in openstack-selinux before they are merged into
the upstream selinux-policy package.

Change-Id: I7c00e5cae17489202fe7aee3e656fca27ab630ba
2014-09-29 21:53:22 -07:00
Jon-Paul Sullivan
4d65e44472 Move dpkg manifest creation to finalise
As some finalise steps can install packages we need to generate the
dpkg manifest after that has occurred.

Change-Id: I2177db2e64d4d9c21deeac7cf017919888a2d524
2014-09-29 16:08:15 +01:00
Ben Nemec
dde3d24213 Allow custom rootfs labels
Per [1], our current root label of cloudimg-root does not work with
XFS because XFS only allows 12 character labels.  This change
addresses that by allowing a custom rootfs label to be specified
in the call to disk-image-create.  There should be no backwards
compatibility concerns as the default label is unchanged.  Any
external elements dealing with the label would need to be updated
to support this new feature, but should continue to work as before
as long as a custom label is not specified.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1139584

Change-Id: I596104d1a63b5dc6549e8460a1ae3da00165ef04
2014-09-26 17:44:08 -05:00
Jenkins
89356c6d34 Merge "Refactor ramdisk element to allow alternate implementations" 2014-09-26 19:23:53 +00:00
Jenkins
78be2a21fe Merge "Add svc-map element." 2014-09-26 18:36:15 +00:00
Ryan Brady
e1853a7d5b Add svc-map element.
Adds a new svc-map element which can be used to install
services based on an in element 'svc-map' YAML config
file format.

This change is intended to decouple elements from DIB
and allow new elements to support multiple distributions
(with various service naming schemes) without having to
constantly maintain DIB's various bin/map-services files.

This patch ensures all of the YAML files are compiled into
a single file without namespaces.  The YAML compilation
process occurs during image creation time and errors if
conflicting mappings are found.

Change-Id: Id11433ea342aace71a358936a7ca3151ec11d506
2014-09-26 12:00:38 -04:00
Ben Nemec
5aca301693 Refactor ramdisk element to allow alternate implementations
In preparation for enabling Dracut-based ramdisks, this change
factors out functionality that is common to both busybox and Dracut
ramdisks.  Said functionality is moved to a ramdisk-base element
which is added as a dependency of the ramdisk element.  ramdisk now
only contains the functionality specific to building busybox-based
ramdisks.

bp tripleo-juno-dracut-ramdisks
Change-Id: Iad2907c8be491c88727d87ed5e5a720e5beb66c3
2014-09-26 00:13:55 -05:00
Jenkins
dbc60e8942 Merge "Change order for yum-repos file in centos7 element" 2014-09-23 11:52:45 +00:00
Jenkins
0b9ffe4a74 Merge "Provide ability to build images for other architectures" 2014-09-23 03:50:38 +00:00
Jenkins
b308c844ae Merge "Adds EPEL repo, cleans up rhel7 repos" 2014-09-20 19:12:05 +00:00
Jenkins
0ddd704e08 Merge "Update to newer Centos7 images" 2014-09-19 22:05:10 +00:00
Ryan Brady
dfd99460c7 Adds EPEL repo, cleans up rhel7 repos
This patch adds a new EPEL element for use with EL-based distros
in accordance with the official docs[1].  This patch also
modifies the rhel7 element to not use the hard-coded repo file.

[1] https://fedoraproject.org/wiki/EPEL

Change-Id: Ib2fa24b2d519837271a0e213a2dc5a012cc31f3c
2014-09-19 07:57:12 -04:00
Ian Wienand
45afb6d86c Update to newer Centos7 images
Update to newer Centos7 images as announced at [1].

Changes included:
 * update to GA image
 * respect TMP_DIR for image working directory
 * use suffix-match rather than prefix-match to build RAW_IMAGE name
   to be more robust against weird names
 * partition layout work-arounds not needed any-more, all one
   partition.

Resulting image booted locally with kvm and virtualbox (after
conversion to vdi)

[1] https://www.redhat.com/archives/rdo-list/2014-August/msg00045.html

Closes-Bug: #1363146
Change-Id: Ie24033468b78587ea87188ee1b843b26895798ff
2014-09-18 10:48:40 +10:00
Jenkins
41ba1d2b9c Merge "Add ceilometer service mappings" 2014-09-17 16:56:30 +00:00
Jenkins
6518876a5f Merge "Use dib-run-parts from dib-utils" 2014-09-17 14:31:49 +00:00
loki
414edd44c2 Provide ability to build images for other architectures
Adds binaries specified by user to chroot environment
allowing to build  images on amd64,i386,armhf,arm64
architectures.
Closes-Bug: #1332458
Change-Id: If6e63a472ee85559b93b5e6b96d9c3ddcf7bcc98
2014-09-16 22:50:17 +05:30
Jenkins
93be491c46 Merge "Reset yum configuration in post-install.d" 2014-09-15 23:03:26 +00:00
Jenkins
137becad69 Merge "Run environment.d hook for manifests earlier" 2014-09-15 21:23:41 +00:00
Jenkins
7ec2c7cdc4 Merge "Add vmedia boot support for deploy-ironic element" 2014-09-15 16:07:09 +00:00