Skip to content

Commit

Permalink
add chef-client provisioner
Browse files Browse the repository at this point in the history
  • Loading branch information
mayn committed Aug 16, 2017
1 parent 06c89c1 commit 2d91228
Show file tree
Hide file tree
Showing 4 changed files with 44 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/ChefClient: add support for packer's chef client provisioner
* 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
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-client
- chef-solo
- converge
- file
Expand Down
34 changes: 34 additions & 0 deletions src/packerlicious/provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,40 @@ class Ansible(PackerProvisioner):
}


class ChefClient(PackerProvisioner):
"""
Chef Client Provisioner
https://www.packer.io/docs/provisioners/chef-client.html
"""
resource_type = "chef-client"

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

props = {
'chef_environment': (basestring, False),
'config_template': (basestring, False),
'encrypted_data_bag_secret_path': (basestring, False),
'execute_command': (basestring, False),
'guest_os_type': (validator.string_list_item([UNIX, WINDOWS]), False),
'install_command': (basestring, False),
'json': (basestring, False),
'knife_command': (basestring, False),
'node_name': (basestring, False),
'prevent_sudo': (validator.boolean, False),
'run_list': ([basestring], False),
'server_url': (basestring, False),
'skip_clean_client': (validator.boolean, False),
'skip_clean_node': (validator.boolean, False),
'skip_install': (validator.boolean, False),
'staging_directory': (basestring, False),
'client_key': (basestring, False),
'validation_client_name': (basestring, False),
'validation_key_path': (basestring, False),
}


class ChefSolo(PackerProvisioner):
"""
Chef Solo Provisioner
Expand Down
8 changes: 8 additions & 0 deletions tests/packerlicious/test_provisioner_chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
import packerlicious.provisioner as provisioner


class TestChefClientProvisioner(object):

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

b.to_dict()


class TestChefSoloProvisioner(object):

def test_no_required_fields(self):
Expand Down

0 comments on commit 2d91228

Please sign in to comment.