Bug 1662937

Summary: [rhel-8]cloud-init does not run chef is install_type is missing
Product: Red Hat Enterprise Linux 8 Reporter: Jaison Raju <jraju>
Component: cloud-initAssignee: Eduardo Otubo <eterrell>
Status: CLOSED NOTABUG QA Contact: Huijuan Zhao <huzhao>
Severity: medium Docs Contact:
Priority: low    
Version: 8.0CC: eterrell, huzhao, jgreguske, jraju, leiwang, linl, mkalinin, mtessun, ribarry, xiachen, yacao, yuxisun
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-06 02:43:44 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:

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: