spot / spot.cloud_modules / 1.3.3 / module / aws_ocean_k8s Create, update or delete Spot Ocean K8s | "added in version" 1.0.0 of spot.cloud_modules" Authors: Spot by NetApp (@jeffnoehren)spot.cloud_modules.aws_ocean_k8s (1.3.3) — module
Install with ansible-galaxy collection install spot.cloud_modules:==1.3.3
collections: - name: spot.cloud_modules version: 1.3.3
Can create, update, or delete Spotinst Ocean You will have to have a credentials file in this location - <home>/.spotinst/credentials The credentials file must contain a row that looks like this token = <YOUR TOKEN> Full documentation available at U(https://help.spotinst.com/hc/en-us/articles/115003530285-Ansible-)
#In this basic example, we create an ocean cluster - hosts: localhost tasks: - name: create ocean aws_ocean_k8s: account_id: YOUR_ACCOUNT_ID token: YOUR_API_TOKEN state: present name: ansible_test_ocean region: us-west-2 controller_cluster_id: ocean.k8s auto_scaler: is_enabled: True cooldown: 180 resource_limits: max_memory_gib: 1500 max_vCpu: 750 down: evaluation_periods: 3 headroom: cpu_per_unit: 2000 memory_per_unit: 0 num_of_units: 4 is_auto_config: True capacity: minimum: 0 maximum: 0 target: 0 strategy: utilize_reserved_instances: False fallback_to_od: True spot_percentage: 100 compute: instance_types: whitelist: - c4.8xlarge subnet_ids: - sg-123456 launch_specification: security_group_ids: - sg-123456 image_id: ami-123456 key_pair: Noam-key tags: - tag_key: tags tag_value: test register: result - debug: var=result
id: description: - Optional parameters for Updating or deleting cluster based on id. Must have uniquness_by set to "id" type: str name: description: - Name for Ocean cluster required: true type: str state: choices: - present - absent default: present description: - create update or delete type: str token: description: - Optional parameter that allows to set an token inside the module configuration. By default this is retrieved from the credentials path type: str region: description: - Region to deploy Ocean cluster instance Groups required: true type: str compute: description: - Schema containing info on the type of compute resources to use required: true type: dict capacity: description: - Schema containing target, min, and max required: true type: dict strategy: description: - Schema containing how to run the cluster required: true type: dict account_id: description: - Optional parameter that allows to set an account-id inside the module configuration. By default this is retrieved from the credentials path type: str auto_scaler: description: - Schema containing info on how auto scaler will function required: true type: dict uniqueness_by: choices: - id - name default: name description: - If your group names are not unique, you may use this feature to update or delete a specific group. Whenever this property is set, you must set a group_id in order to update or delete a group, otherwise a group will be created. type: str credentials_path: default: /root/.spotinst/credentials description: - Optional parameter that allows to set a non-default credentials path. type: str controller_cluster_id: description: - This ID must be unique for each Ocean cluster per account required: true type: str
result: description: Created Ocean Cluster successfully returned: success sample: o-d861f48d type: str