Skip to content

Commit

Permalink
add chef-solo provisioner
Browse files Browse the repository at this point in the history
  • Loading branch information
mayn committed Aug 16, 2017
1 parent cb7aebd commit 06c89c1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
## (UNRELEASED)

### FEATURES:
* provisioner/ChefSolo: add support for packer's chef solo provisioner
* provisioner/Converge: add support for packer's converge provisioner
* provisioner/PowerShell: add support for packer's powershell provisioner
* provisioner/PuppetMasterless: add support for packer's puppet masterless provisioner
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Provisioners:

- ansible-local
- ansible
- chef-solo
- converge
- file
- powershell
Expand Down
32 changes: 32 additions & 0 deletions src/packerlicious/provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,38 @@ class Ansible(PackerProvisioner):
}


class ChefSolo(PackerProvisioner):
"""
Chef Solo Provisioner
https://www.packer.io/docs/provisioners/chef-solo.html
"""
resource_type = "chef-solo"

# guest_os_type options
UNIX = "unix"
WINDOWS = "windows"

props = {
'chef_environment': (basestring, False),
'config_template': (basestring, False),
'cookbook_paths': (basestring, False),
'data_bags_path': (basestring, False),
'encrypted_data_bag_secret_path': (basestring, False),
'environments_path': (basestring, False),
'execute_command': (basestring, False),
'guest_os_type': (validator.string_list_item([UNIX, WINDOWS]), False),
'install_command': (basestring, False),
'json': (basestring, False),
'prevent_sudo': (validator.boolean, False),
'remote_cookbook_paths': ([basestring], False),
'roles_path': (basestring, False),
'run_list': ([basestring], False),
'skip_install': (validator.boolean, False),
'staging_directory': (basestring, False),
'version': (basestring, False),
}


class ModuleDirectory(PackerProperty):
"""
https://www.packer.io/docs/provisioners/converge.html#module-directories
Expand Down
11 changes: 11 additions & 0 deletions tests/packerlicious/test_provisioner_chef.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest

import packerlicious.provisioner as provisioner


class TestChefSoloProvisioner(object):

def test_no_required_fields(self):
b = provisioner.ChefSolo()

b.to_dict()

0 comments on commit 06c89c1

Please sign in to comment.