summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_chef.py
AgeCommit message (Collapse)Author
2020-06-29Add schema for cc_chef module (#375)lucasmoura
Create a schema object for the chef module and validate this schema in the handle function of the module. Some of the config keys description, so I tried looking at the code and chef documentation to provide an information to the user. However, I don't know if I have the best description for all fields. For example, for the key show_time I could not find an accurate description of what it did, so I used what was in our code base to infer what it should do. LP: #1858888
2020-06-08Replace cc_chef is_installed with use of subp.is_exe. (#421)Scott Moser
This was brought up in review of #416. Makes sense to remove the local copy of "is this executable file".
2020-06-08Move subp into its own module. (#416)Scott Moser
This was painful, but it finishes a TODO from cloudinit/subp.py. It moves the following from util to subp: ProcessExecutionError subp which target_path I moved subp_blob_in_tempfile into cc_chef, which is its only caller. That saved us from having to deal with it using write_file and temp_utils from subp (which does not import any cloudinit things now). It is arguable that 'target_path' could be moved to a 'path_utils' or something, but in order to use it from subp and also from utils, we had to get it out of utils.
2020-05-27Enable chef_license support for chef infra client (#389)Bipin Bachhao
Co-authored-by: Daniel Watkins <oddbloke@ubuntu.com>
2020-01-21Drop most of the remaining use of six (#179)Daniel Watkins
2019-10-17replace any deprecated log.warn with log.warningDominic Schlegel
Commit 6797e822959b84c98cf73e02b2a6e3d6ab3fd4fe replaced the LOG.warn calls that linters were warning about; this also replaces calls that linters would not have recognised (as `log` is generally a parameter in these scenarios). LP: #1508442
2019-02-25Enable encrypted_data_bag_secret support for ChefEric Williams
Encrypted data bags require a secrets file to be present to decrypt, and the location of the file must be configured the Chef client configuration file, client.rb. This update enables cloud-init's chef module to update that setting in client.rb. LP: #1817082
2017-09-13chef: Add option to pin chef omnibus install versionEthan Apodaca
Most users of chef will want to pin the version that is installed. Typically new versions of chef have to be evaluated for breakage etc. This change proposes a new optional `omnibus_version` field to the chef configuration. The changeset also adds documentation referencing the new field. LP: #1462693
2017-09-07Use /run/cloud-init for tempfile operations.Scott Moser
During boot, the usage of /tmp is not safe. In systemd systems, systemd-tmpfiles-clean may run at any point and clear out a temp file while cloud-init is using it. The solution here is to use /run/cloud-init/tmp. LP: #1707222
2017-06-08Chef: Update omnibus url to chef.io, minor doc changes.JJ Asghar
- Updated to standard chef.io url - Removed the port 4000, due to that has been deprecated - Added Note about the run_list not being required Signed-off-by: JJ Asghar <jj@chef.io>
2017-03-13Fix chef config module in omnibus install.Jeremy Melvin
Omnibus installation of chef was broken under python3. LP: #1583837
2016-12-22LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm
This has been a recurring ask and we had initially just made the change to the cloud-init 2.0 codebase. As the current thinking is we'll just continue to enhance the current codebase, its desirable to relicense to match what we'd intended as part of the 2.0 plan here. - put a brief description of license in LICENSE file - put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0 - simplify the per-file header to reference LICENSE - tox: ignore H102 (Apache License Header check) Add license header to files that ship. Reformat headers, make sure everything has vi: at end of file. Non-shipping files do not need the copyright header, but at the moment tests/ have it.
2016-09-30Improve module documentation and doc cleanup.Wesley Wiedenmeier
This adds lots of config module documentation in a standard format. It will greatly improve the content at readthedocs. Additionally: * Add a 'doc' env to tox.ini * Changed default highlight language for sphinx conf from python to yaml most examples in documentation are yaml configs * Updated datasource examples to highlight sh code properly
2016-04-13chef: straighten out validation_cert and validation_keyScott Moser
Now, validation_key is always a path to a file, as it is in chef's client.rb syntax. validation_cert is always the *content* of that file that should be written. However, if validation_cert is the string "system", then we do not write that value, but rather assume the file exists. LP: #1568940
2016-04-12provide a warning if 'system' but file does not existScott Moser
2016-04-12chef: straighten out validation_cert and validation_keyScott Moser
Now, validation_key is always a path to a file, as it is in chef's client.rb syntax. validation_cert is always the *content* of that file that should be written. However, if validation_cert is the string "system", then we do not write that value, but rather assume the file exists. LP: #1568940
2016-04-04chef: fix chef installation from gemsScott Moser
Installation from gems was previously always broken. This fixes the order or parameters calling install_chef_from_gems. LP: #1553345
2015-01-27Respond to review:Barry Warsaw
- Remove str() wrappers to second argument to write_files() where it is no longer necessary. Also: Fixed a couple of other octal literals which clearly weren't being tested.
2015-01-22Low hanging Python 3 fruit.Barry Warsaw
2014-11-22Update to use a newer and better OMNIBUS_URLJoshua Harlow
This is minor change which uses the new Chef (company) top level domain for grabbing the Omnibus installation shell script.
2014-11-21Ensure the cc_chef doc links to the cc_chef codeJoshua Harlow
2014-11-21Update chef module docstring to reflect the new styleJoshua Harlow
2014-10-15Prefer immutable structuresJoshua Harlow
2014-10-13Use the key contants in the default key => value setJoshua Harlow
2014-10-13Add a post-run method that can be used to delete validation.pem filesJoshua Harlow
For those who run chef in non-daemon mode, they would like to delete the validation.pem file if chef finishes as expected to remove that file from existing in an easy to read manner.
2014-10-12Retain the old behavior for mandatory keysJoshua Harlow
The keys 'server_url' and 'validation_name' were previously mandatory, we should retain that behavior for now.
2014-10-11Add a comment explaining the param path logicJoshua Harlow
2014-10-11Allow running even if installedJoshua Harlow
Standardize on using the chef_cfg key 'exec' which can be used when installing to tell the caller to run the chef client or can also be used if the client is already installed and its requested to be ran. To retain existing behavior 'exec' does not by default assume to be true, unless explicitly provided or a gems mode install is requested.
2014-10-11Follow the same constant variable naming scheme for the path tpl keysJoshua Harlow
2014-10-11Have the caller find the param paths instead of the param creatorJoshua Harlow
2014-10-11Ensure that any template paths have associated directoriesJoshua Harlow
When the template provides a path, make sure that before the template is written that the path that is now in the template has the associated directory created (if not already created).
2014-10-11Move the chef running to its own helper functionJoshua Harlow
2014-10-11Always ensure we create the /etc/chef dirJoshua Harlow
2014-10-11Use the util function to get the chef base directoriesJoshua Harlow
2014-10-11Allow the omnibus url fetching retries to be configurableJoshua Harlow
2014-10-11Allow for the running after install and run arguments to be configuredJoshua Harlow
Instead of only running the client when installed from gems, allow it to be ran from other install modes as well (if configured) and allow the arguments that are passed to the client when ran to be altered (if so desired).
2014-10-11More adjustmentsJoshua Harlow
- Use the generated_by() utility function to give the ruby template a better header comment - Set special parameters after selecting the basic chef parameters.
2014-10-11Some more reworkingsJoshua Harlow
- Make a helper function to tell if already installed. - Have the install routine not run chef after installed but have it instead return a result to tell the caller to run the chef program once completed.
2014-10-10Move the installation code to its own functionJoshua Harlow
2014-10-10Increase the robustness of the chef moduleJoshua Harlow
Add the following adjustments to the chef template and module - Make it so that the chef directories can be provided (defaults to the existing directories) - Make the params much more configurable, and if a parameter is provided in the chef configuration it will override existing template parameters. - Make the template skip lines if the values are None in the configuration so that template lines can be removed if/when this is desirable. - Allow the firstboot json path to be configurable (defaults to the existing location). - Adds a basic set of tests to ensure that good things are happening.
2014-09-10cc_chef: Update omnibus URL to new Chef TLD.John Bellone
2014-08-26fix(pep8): Fix various pep8 violations and version-lock pep8Jay Faulkner
Fixed all complaints from running "make pep8". Also version locked pep8 in test-requirements.txt to ensure that pep8 requirements don't change without an explicit commit.
2013-05-20Fix Chef client 'omnibus' install; util.write_file() expects a string not ↵Chris Wing
UrlResponse
2012-12-12add 'omnibus' as an install type for chef.Scott Moser
Thanks to Anatoliy Dobrosynets
2012-10-27Helpful cleanups.harlowja
1. Remove the usage of the path.join function now that all code should be going through the util file methods (and they can be mocked out as needed). 2. Adjust all occurences of the above join function to either not use it or replace it with the standard os.path.join (which can also be mocked out as needed) 3. Fix pylint from complaining about the tests folder 'helpers.py' not being found 4. Add a pylintrc file that is used instead of the options hidden in the 'run_pylint' tool.
2012-06-221. Move the getkeybyid function back here but add some slight adjustmentsJoshua Harlow
a. Instead of executing a bash string, write out a temporary file and then just execute '/bin/sh' on that file with the right arguments instead. 2. Rename util.SilentTemporaryFile to util.ExtendedTemporaryFile and update the usages of the previous name accordingly, this better reflects what this temp file is. 3. More teenie pep8 line length fixings
2012-06-22Disable capturing of these subp callsJoshua Harlow
2012-06-211. Renames for debug message from 'transform' to 'module'harlowja
2. Fixing up more cloud.path.joins found to use the right ro/rw filename
2012-06-20Massive pylint + pep8 fixups!Joshua Harlow
2012-06-20Renamed back to 'cc_*' with the reasoning being that 'cc_' providesJoshua Harlow
some protection against module name collisions when importing.