diff --git a/README.md b/README.md index 6102684..39835af 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,11 @@ These settings are optional: - `volume_id`, If you wish to clone your volume from an existing volume set this to the source volume's ID. They must be in the same Availability Domain. - `nsg_ids`, The option to connect up to 5 Network Security Groups to compute instance. - `custom_metadata`, Add metadata to the compute instance request + - `instance_options`, A hash of optional mutable instance options. + Initially, the only option [supported in the Ruby SDK](https://docs.oracle.com/en-us/iaas/tools/ruby/latest/OCI/Core/Models/InstanceOptions.html) + is `are_legacy_imds_endpoints_disabled`. + Customers who have [migrated to IMDSv2](https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/gettingmetadata.htm#upgrading-v2) + should set this to `true` - `all_plugins_disabled`, Whether Oracle Cloud Agent can run all the available plugins (default: `false`) - `management_disabled`, Whether Oracle Cloud Agent can run all the available management plugins (default: `false`) - `monitoring_disabled`, Whether Oracle Cloud Agent can gather performance metrics and monitor the instance using the monitoring plugins (default: `false`) diff --git a/lib/kitchen/driver/oci.rb b/lib/kitchen/driver/oci.rb index ce5747d..b7bf3ea 100644 --- a/lib/kitchen/driver/oci.rb +++ b/lib/kitchen/driver/oci.rb @@ -82,6 +82,7 @@ class Oci < Kitchen::Driver::Base default_config :post_create_reboot, false # compute only configs + default_config :instance_options, {} default_config :capacity_reservation_id default_config :setup_winrm, false default_config :winrm_user, "opc" diff --git a/lib/kitchen/driver/oci/instance/compute.rb b/lib/kitchen/driver/oci/instance/compute.rb index 47ac1c0..3e7339c 100644 --- a/lib/kitchen/driver/oci/instance/compute.rb +++ b/lib/kitchen/driver/oci/instance/compute.rb @@ -81,6 +81,13 @@ def instance_source_via_image ) end + # Adds the instance options property to the launch details. + def instance_options + return if config[:instance_options].empty? + + launch_details.instance_options = OCI::Core::Models::InstanceOptions.new(config[:instance_options]) + end + # Adds the source_details property to the launch_details for an instance that is being created from a boot volume. def instance_source_via_boot_volume return unless config[:boot_volume_id] diff --git a/lib/kitchen/driver/oci_version.rb b/lib/kitchen/driver/oci_version.rb index 5b75929..fe47b77 100644 --- a/lib/kitchen/driver/oci_version.rb +++ b/lib/kitchen/driver/oci_version.rb @@ -22,6 +22,6 @@ module Driver # Version string for Oracle OCI Kitchen driver # # @author Stephen Pearson () - OCI_VERSION = "1.27.0" + OCI_VERSION = "1.28.0" end end