Commit Graph

1454 Commits

Author SHA1 Message Date
Michael Kerrin
6337e6fe17 Fix issue with leaking /tmp/image.* directories
When building the ramdisk we don't cleanup the temporary
directories after ourselves. This leaves /tmp/image.* directories
mounted and /tmp/image.* directories on the system.

Also the ramdisk-functions duplicate, from what I can see,
the cleanup function from common-functions. So when a job
is killed off it ends up leaving /tmp/image.* directories
on the system.

Change-Id: I2d73aabd0eb176027b4e7368580db08902e2b6ab
2015-01-28 12:07:07 +00:00
Dmitry Tantsur
04a542134f ironic-discoverd-ramdisk element cleanup
- Properly rename files
- Use new package-installs
- Properly check for discoverd_callback_url option
  (and return backward compatibility)

Change-Id: I2247047b9360945408e720329d5b134cfa384ae5
2015-01-27 10:59:37 +01:00
Jenkins
87b4bc7d51 Merge "Run Registration Once" 2015-01-24 19:02:13 +00:00
Giulio Fidente
cde4cef215 Switch manage_etc_hosts from True to localhost
When set to true this cloud-init setting overwrites the /etc/hosts
file at reboot, breaking stuff in TripleO where controllers rely
on resolving each other by name. We still want cloud-init to add in
there a mapping for the local fqdn, so we switched to 'localhost' [1]

1. http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt#L470

Change-Id: I85468dece3b67f39841aa826f9b7ca4bf113027a
Closes-Bug: 1411594
2015-01-21 13:21:53 +01:00
Jenkins
302fdd57bb Merge "Add install section to Ironic agent systemd service file" 2015-01-21 08:58:23 +00:00
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
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
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
9981f94828 Merge "Continue past dependency ordering diffs." 2015-01-08 10:20:16 +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
0516d45f8e Merge "Fail helpfully if uuidgen is missing" 2014-12-23 23:27:27 +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
Gregory Haynes
c94880aa2f Fail helpfully if uuidgen is missing
If uuidgen is not installed we currently fail when performing tune2fs.

Change-Id: I4062eb1d62322c455dac5b83b856f454da211320
2014-12-15 15:42:35 -08:00
Chris Jones
f4a2eb6ef3 Continue past dependency ordering diffs.
We now guard against diff returning non-zero (which it does when it
discovers changes). This allows dib-lint runs to continue past the point
of displaying a dependency ordering nit.

Change-Id: Ib7801597400d6d87146181935922c8832baf5aaa
2014-12-12 18:36:55 +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
Jenkins
2dfb931d95 Merge "Use env python" 2014-12-11 21:26:03 +00: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
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