Bug 1662937 - cloud-init does not run chef is install_type is missing
Summary: cloud-init does not run chef is install_type is missing
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cloud-init
Version: 7.6
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Eduardo Otubo
QA Contact: Vratislav Hutsky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-02 13:13 UTC by Jaison Raju
Modified: 2020-02-13 17:18 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3785321 None None None 2019-06-24 19:38:50 UTC

Description Jaison Raju 2019-01-02 13:13:34 UTC
Description of problem:
If install_type is not defined, exec defaults to false.
In cloud images for environment with limited network, it is common that the chef client packages are already present in the RHEL image.
./cloudinit/config/cc_chef.py
    force_install = util.get_cfg_option_bool(chef_cfg,
                                             'force_install', default=False)
    if not is_installed() or force_install:
        run = install_chef(cloud, chef_cfg, log)
    elif is_installed():
        run = util.get_cfg_option_bool(chef_cfg, 'exec', default=False)
    else:
        run = False
    if run:
        run_chef(chef_cfg, log)
        post_run_chef(chef_cfg, log)

This behaviour should either be documented or should be changed.

chef:
 install_type: "gems"
 exec: true

Version-Release number of selected component (if applicable):
all versions since chef option was available

How reproducible:
always

Steps to Reproduce:
1. Build an image with chef client.

2. Use this example or similar example which does not have install_type.
https://cloudinit.readthedocs.io/en/latest/topics/examples.html

3. 

Actual results:
chef does not run

Expected results:
chef client runs & performs the tasks.

Additional info:


Note You need to log in before you can comment on or make changes to this bug.