Having multiple values in a yumrepos key results in incorrectly formatted yum repo config

Bug #1592150 reported by Jeff Wang on 2016-06-13
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Medium
Dylan Perry

Bug Description

According to the code to handle yumrepos, cloud-init "Can handle 'lists' in certain cases".

When I specify a list in my cloud-config, it is incorrectly formatted. It is surrounded by '''triple single-quotes''' when rendered onto the filesystem, causing the resulting configuration to be invalid.

I am using cloud-init from Centos7, from the amazon ami marketplace:

$ rpm -qi cloud-init
Name : cloud-init
Version : 0.7.5
Release : 10.el7.centos.1
Architecture: x86_64
Install Date: Tue 29 Mar 2016 08:43:31 PM UTC
Group : System Environment/Base
Size : 1432841
License : GPLv3
Signature : RSA/SHA256, Wed 10 Sep 2014 12:33:32 PM UTC, Key ID 24c6a8a7f4a80eb5
Source RPM : cloud-init-0.7.5-10.el7.centos.1.src.rpm
Build Date : Wed 10 Sep 2014 11:05:45 AM UTC
Build Host : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://launchpad.net/cloud-init
Summary : Cloud instance init scripts
Description :
Cloud-init is a set of init scripts for cloud instances. Cloud instances
need special scripts to run during initialization to retrieve and install
ssh keys and to let the user run various scripts.

Example configuration:

yum_repos:
    saltstack:
        name: SaltStack repo for Red Hat Enterprise Linux $releasever
        baseurl: https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
        enabled: true
        gpgcheck: true
        gpgkey:
            - https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
            - https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7

Result of Example configuration:

# Created by cloud-init on Mon, 13 Jun 2016 20:05:01 +0000
[saltstack]
gpgcheck = 1
gpgkey = '''https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
    https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7'''
enabled = 1
baseurl = https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
name = SaltStack repo for Red Hat Enterprise Linux $releasever

Related branches

Scott Moser (smoser) on 2017-04-21
Changed in cloud-init:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Dylan Perry (dylan.perry)
status: Confirmed → Fix Committed

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers