Skip to content

Commit

Permalink
packer v1.2.4 sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mayn committed May 31, 2018
1 parent 5c5fb49 commit 18cc968
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 10 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@

## (UNRELEASED)


## 0.8.0 (May 30, 2018)

packer v1.2.4 feature sync [GH-107]

### BUG FIX:
* builder/AliCloud: correct image_disk_mappings definition, disk_delete_with_instance datatype

### MISC:
* (builder, post-processor, provisioner): additional properties




## 0.7.0 (April 22, 2018)
Expand Down
25 changes: 19 additions & 6 deletions src/packerlicious/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ class PackerCommunicator(BasePackerObject):
'ssh_username': (str, False),
# WinRM communicator props
'winrm_host': (str, False),
'winrm_insecure': (validator.boolean, False),
'winrm_port': (validator.integer, False),
'winrm_username': (str, False),
'winrm_password': (str, False),
'winrm_timeout': (str, False),
'winrm_username': (str, False),
'winrm_use_ssl': (validator.boolean, False),
'winrm_insecure': (validator.boolean, False),
'winrm_use_ntlm': (validator.boolean, False),

}
Expand Down Expand Up @@ -155,7 +155,6 @@ class BlockDeviceMapping(PackerProperty):
'delete_on_termination': (validator.boolean, False),
'device_name': (str, False),
'encrypted': (validator.boolean, False),
'kms_key_id': (str, False),
'iops': (int, False),
'no_device': (validator.boolean, False),
'snapshot_id': (str, False),
Expand Down Expand Up @@ -204,6 +203,7 @@ class AmazonEbs(PackerBuilder):
'enhanced_networking': (validator.boolean, False),
'force_deregister': (validator.boolean, False),
'force_delete_snapshot': (validator.boolean, False),
'enable_t2_unlimited': (validator.boolean, False),
'encrypt_boot': (validator.boolean, False),
'kms_key_id': (str, False),
'iam_instance_profile': (str, False),
Expand Down Expand Up @@ -287,8 +287,9 @@ class AmazonChroot(PackerBuilder):
'root_device_name': (str, False),
'mfa_code': (str, False),
'mount_path': (str, False),
'mount_partition': (int, False),
'mount_partition': (str, False),
'mount_options': ([str], False),
'nvme_device_path': (str, False),
'pre_mount_commands': ([str], False),
'profile': (str, False),
'post_mount_commands': ([str], False),
Expand Down Expand Up @@ -341,6 +342,7 @@ class AmazonEbsSurrogate(PackerBuilder):
'disable_stop_instance': (validator.boolean, False),
'ebs_optimized': (validator.boolean, False),
'ena_support': (validator.boolean, False),
'enable_t2_unlimited': (validator.boolean, False),
'force_deregister': (validator.boolean, False),
'force_delete_snapshot': (validator.boolean, False),
'encrypt_boot': (validator.boolean, False),
Expand Down Expand Up @@ -413,6 +415,7 @@ class AmazonEbsVolume(PackerBuilder):
'custom_endpoint_ec2': (str, False),
'ebs_optimized': (validator.boolean, False),
'ena_support': (validator.boolean, False),
'enable_t2_unlimited': (validator.boolean, False),
'iam_instance_profile': (str, False),
'mfa_code': (str, False),
'profile': (str, False),
Expand Down Expand Up @@ -498,6 +501,7 @@ class AmazonInstance(PackerBuilder):
'custom_endpoint_ec2': (str, False),
'ebs_optimized': (validator.boolean, False),
'enhanced_networking': (validator.boolean, False),
'enable_t2_unlimited': (validator.boolean, False),
'force_deregister': (validator.boolean, False),
'force_delete_snapshot': (validator.boolean, False),
'iam_instance_profile': (str, False),
Expand Down Expand Up @@ -567,12 +571,12 @@ class Azure(PackerBuilder):
'client_secret': (str, True),
'subscription_id': (str, True),
'build_resource_group_name': (str, False),
'capture_container_name': (str, False),
'capture_name_prefix': (str, False),
'image_publisher': (str, True),
'image_offer': (str, True),
'image_sku': (str, True),
'location': (str, True),
'async_resourcegroup_delete': (validator.boolean, False),
'azure_tags': (dict, False),
'cloud_environment_name': (str, False),
'custom_data_file': (str, False),
Expand All @@ -583,7 +587,6 @@ class Azure(PackerBuilder):
'image_url': (str, False),
'managed_image_name': (str, False),
'managed_image_resource_group_name': (str, False),
'object_id': (str, False),
'os_disk_size_gb': (int, False),
'os_type': (str, False),
'temp_compute_name': (str, False),
Expand Down Expand Up @@ -804,6 +807,7 @@ class HypervIso(PackerBuilder):
'boot_wait': (str, False),
'cpu': (int, False),
'disk_additional_size': ([int], False),
'disk_block_size': (str, False),
'disk_size': (int, False),
'differencing_disk': (validator.boolean, False),
'enable_dynamic_memory': (validator.boolean, False),
Expand All @@ -815,6 +819,7 @@ class HypervIso(PackerBuilder):
'generation': (int, False),
'guest_additions_mode': (str, False),
'guest_additions_path': (str, False),
'headless': (validator.boolean, False),
'http_directory': (str, False),
'http_port_min': (int, False),
'http_port_max': (int, False),
Expand All @@ -827,10 +832,12 @@ class HypervIso(PackerBuilder):
'secondary_iso_images': ([str], False),
'shutdown_command': (str, False),
'shutdown_timeout': (str, False),
'secure_boot_template': (str, False),
'skip_compaction': (validator.boolean, False),
'skip_export': (validator.boolean, False),
'switch_name': (str, False),
'switch_vlan_id': (str, False),
'use_fixed_vhd_format': (validator.boolean, False),
'vhd_temp_path': (str, False),
'vlan_id': (str, False),
'vm_name': (str, False),
Expand Down Expand Up @@ -861,6 +868,7 @@ class HypervVmcx(PackerBuilder):
'floppy_dirs': ([str], False),
'guest_additions_mode': (str, False),
'guest_additions_path': (str, False),
'headless': (validator.boolean, False),
'http_directory': (str, False),
'http_port_min': (int, False),
'http_port_max': (int, False),
Expand All @@ -873,6 +881,7 @@ class HypervVmcx(PackerBuilder):
'mac_address': (str, False),
'output_directory': (str, False),
'ram_size': (int, False),
'secure_boot_template': (str, False),
'secondary_iso_images': ([str], False),
'shutdown_command': (str, False),
'shutdown_timeout': (str, False),
Expand Down Expand Up @@ -1018,6 +1027,7 @@ class OpenStack(PackerBuilder):
'insecure': (validator.boolean, False),
'key': (str, False),
'metadata': (dict, False),
'instance_name': (str, False),
'instance_metadata': (dict, False),
'networks': ([str], False),
'rackconnect_wait': (validator.boolean, False),
Expand Down Expand Up @@ -1091,6 +1101,8 @@ class OracleOCI(PackerBuilder):
'tenancy_ocid': (str, False),
'user_ocid': (str, False),
'use_private_ip': (str, False),
'user_data': (str, False),
'user_data_file': (str, False),
}


Expand Down Expand Up @@ -1299,6 +1311,7 @@ class Triton(PackerBuilder):
'triton_url': (str, False),
'triton_user': (str, False),
'triton_key_material': (str, False),
'insecure_skip_tls_verify': (validator.boolean, False),
'source_machine_image_filter': (TritonSourceMachineImageFilter, False),
'source_machine_firewall_enabled': (validator.boolean, False),
'source_machine_metadata': (dict, False),
Expand Down
5 changes: 4 additions & 1 deletion src/packerlicious/post_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,16 +274,19 @@ class ShellLocal(PackerPostProcessor):
PackerBuildType = EnvVar("PACKER_BUILD_TYPE")

props = {
'command': (str, False),
'inline': ([str], False),
'script': (str, False),
'scripts': ([str], False),
'environment_vars': ([str], False),
'execute_command': (str, False),
'execute_command': ([str], False),
'inline_shebang': (str, False),
'use_linux_pathing': (validator.boolean, False),
}

def validate(self):
conds = [
'command',
'inline',
'script',
'scripts',
Expand Down
22 changes: 21 additions & 1 deletion src/packerlicious/provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class Ansible(PackerProvisioner):
'extra_arguments': ([str], False),
'groups': ([str], False),
'host_alias': (str, False),
'inventory_file': (str, False),
'inventory_directory': (str, False),
'local_port': (str, False),
'sftp_command': (str, False),
Expand Down Expand Up @@ -114,6 +115,7 @@ class ChefClient(PackerProvisioner):
'server_url': (str, False),
'skip_clean_client': (validator.boolean, False),
'skip_clean_node': (validator.boolean, False),
'skip_clean_staging_directory': (validator.boolean, False),
'skip_install': (validator.boolean, False),
'staging_directory': (str, False),
'trusted_certs_dir': (str, False),
Expand Down Expand Up @@ -205,6 +207,7 @@ class File(PackerProvisioner):
'source': (str, True),
'destination': (str, True),
'direction': (validator.string_list_item([Upload, Download]), True),
'generated': (validator.boolean, False),
}


Expand Down Expand Up @@ -234,6 +237,7 @@ class PowerShell(PackerProvisioner):
'elevated_user': (str, False),
'elevated_password': (str, False),
'remote_path': (str, False),
'remote_env_var_path': (str, False),
'skip_clean': (validator.boolean, False),
'start_retry_timeout': (str, False),
'valid_exit_codes': ([int], False),
Expand Down Expand Up @@ -292,6 +296,7 @@ class PuppetServer(PackerProvisioner):
'puppet_node': (str, False),
'puppet_server': (str, False),
'staging_dir': (str, False),
'working_directory': (str, False),
}


Expand Down Expand Up @@ -384,10 +389,25 @@ class ShellLocal(PackerProvisioner):
Command = TemplateVar("Command")

props = {
'command': (str, True),
'command': (str, False),
'inline': ([str], False),
'script': (str, False),
'scripts': ([str], False),
'environment_vars': ([str], False),
'execute_command': ([str], False),
'inline_shebang': (str, False),
'use_linux_pathing': (validator.boolean, False),
}

def validate(self):
conds = [
'command',
'inline',
'script',
'scripts'
]
validator.exactly_one(self.__class__.__name__, self.properties, conds)


class WindowsShell(PackerProvisioner):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/packerlicious/test_post_processor_shell_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def test_required_fields(self):

with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert u'one of the following must be specified: inline, script, scripts' in str(excinfo.value)
assert u'one of the following must be specified: command, inline, script, scripts' in str(excinfo.value)
2 changes: 1 addition & 1 deletion tests/packerlicious/test_provisioner_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ def test_required_fields_missing(self):

with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'required' in str(excinfo.value)
assert u'one of the following must be specified: inline, script, scripts' in str(excinfo.value)

0 comments on commit 18cc968

Please sign in to comment.