Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1027406

Summary: cloud-init should probably have yum_add_repo module enabled
Product: Red Hat Enterprise Linux 6 Reporter: Jaroslav Henner <jhenner>
Component: cloud-initAssignee: Lars Kellogg-Stedman <lars>
Status: CLOSED CURRENTRELEASE QA Contact: mkovacik
Severity: high Docs Contact:
Priority: high    
Version: 6.5CC: erich, jgreguske, kcleveng
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cloud-init-0.7.5-1.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 1032163 1233854 (view as bug list) Environment:
Last Closed: 2014-09-08 19:05:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1032163, 1056732, 1233854    

Description Jaroslav Henner 2013-11-06 18:37:39 UTC
Description of problem:
on RHEL/FEDORA it would certainly be wise to enable cloud-init module yum_add_repo which adds possibility to add repo easily from the cloud-config like: 

-----8<-----8<-----8<-----
#cloud-config
yum_repos:
    latest_releng_rhel:
        baseurl: http://download....redhat.com/pub/rhel/rel-eng/latest-RHEL-6/6.5/Server/x86_64/os/Server/
        enabled: true
        gpgcheck: false
        name: Latest RHEL 6.5 snapshot
-----8<-----8<-----8<-----

Version-Release number of selected component (if applicable):
cloud-init.noarch      0.7.2-2.el6

How reproducible:
always


Steps to Reproduce:
1. check whether the above cloud-config creates the repo
2.
3.

Actual results:
no repo created

Expected results:
 * The module is enabled in /etc/cloud/cloud.cnf

  cloud_init_modules:
   - yum_add_repo

 * repo created

Additional info:

Comment 1 Jaroslav Henner 2013-11-06 18:43:45 UTC
the workaround is to list the modules in the cloud-config, but it would be convenient to have the module on yum systems by default.

cloud_init_modules:
 - bootcmd
 - write-files
 - resizefs
 - set_hostname
 - update_hostname
 - update_etc_hosts
 - rsyslog
 - users-groups
 - ssh
 - yum_add_repo

Comment 3 RHEL Program Management 2013-11-09 19:15:15 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 Jaroslav Henner 2014-04-25 23:31:46 UTC
There is a workaround. Adding this to the cloud-config makes cloud-init to reconfigure itself at very early stage of the booting, so it will enable the yum_add_repo for itself.

bootcmd:
        - 'echo "  - yum_add_repo:" >> /etc/cloud/cloud.cnf'

Comment 5 Jaroslav Henner 2014-04-26 17:35:01 UTC
(In reply to Jaroslav Henner from comment #4)
> There is a workaround. Adding this to the cloud-config makes cloud-init to
> reconfigure itself at very early stage of the booting, so it will enable the
> yum_add_repo for itself.
> 
> bootcmd:
>         - 'echo "  - yum_add_repo:" >> /etc/cloud/cloud.cnf'

Sorry, I made a mistake. This doesn't work, but following workaround does:


bootcmd:
        - 'sed -i "s/cloud_config_modules:/&\n - yum_add_repo/" /etc/cloud/cloud.cfg'
yum_repos:
    rhel:
        baseurl: 'http://AAA/bbb/ccc/'
        enabled: true
        gpgcheck: false
        name: RHEL

runcmd:
        - |
          yum install openstack-packstack -y


Note that one cannot use the cloud-init "packages". It doesn't work.

Comment 7 Lars Kellogg-Stedman 2014-09-08 19:05:07 UTC
The default cloud.cfg in the 0.7.5 packages includes the yum-add-repo module.