Skip to content

Commit

Permalink
Azure V3 Elastigroup support in Ansible spot.cloud_modules (#9)
Browse files Browse the repository at this point in the history
* Draft

* Draft

* updated version

* Fixing documentation

* Documentation Fixes

* Fix type of preferred_zone parameter

* debugging

* reverting the MI changes made for debugging

* Minor changes

* Minor changes

* updated version

* Deletion Config Fixed

* Fixing Tests

* Fixing some of the lint Issues reported by sanity test run

* Updating broken links in the README.md

* Fixing module_utils location

* Documentation Fixes

* initial version

* corrected the documentation

* Updating python version in workflows

* Intermediate version check-in

* Correcting Image field dicts

* Fixing the list parameters.

* Changing HAS_ANSIBLE_MODULE to use global scope

* azure v3 changes

* Minor Fixes in data-types

* Lint Fixes

* Static Analysis Fixes

* Static Analysis fixes

* Update changelog.rst

* Changelog update

* review comments fixed

* Resolved the module import error

* module_utils fixes

* Removed temporary debug statements

---------

Co-authored-by: John Samuel <john.samuel@netapp.com>
  • Loading branch information
anuragsharma-123 and johnSamuelNetapp authored Apr 4, 2023
1 parent 6c28347 commit 032fe70
Show file tree
Hide file tree
Showing 12 changed files with 1,789 additions and 7 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,18 @@ Adding support for Azure Stateful Nodes.
New Modules
-----------

- spot.cloud_modules.azure_stateful_node - Manage (Create, Update, Delete) Azure Stateful Nodes
- spot.cloud_modules.azure_stateful_node - Manage (Create, Update, Delete) Azure Stateful Nodes


v1.2.0
======

Release Summary
---------------

Adding support for Azure Elastigroups.

New Modules
-----------

- spot.cloud_modules.azure_elastigroup - Manage (Create, Update, Delete) Azure Elastigroups
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Version 2 of Spot's Python SDK does not support Python 2.7 so this collection re

## Spot Python SDK compatibility

Version `1.1.0` of this collection requires at least version `2.1.29` of Spot's Python SDK.
Version `1.2.0` of this collection requires at least version `2.1.30` of Spot's Python SDK.

## Included content

Expand All @@ -30,6 +30,7 @@ Name | Description
[spot.cloud_modules.aws_mrscaler](https://github.com/spotinst/spot-ansible-cloud-modules/blob/main/docs/examples/emr/README.md)|Manage Spot MR Scalers
[spot.cloud_modules.event_subscription](https://github.com/spotinst/spot-ansible-cloud-modules/blob/main/docs/examples/events/README.md)|Manage Spot Event Subscriptions
[spot.cloud_modules.azure_stateful_node](https://github.com/spotinst/spot-ansible-cloud-modules/blob/main/docs/examples/stateful_node/README.md)|Manage Azure Stateful Nodes
[spot.cloud_modules.azure_elastigroup](https://github.com/spotinst/spot-ansible-cloud-modules/blob/main/docs/examples/elastigroup/README.md)|Manage Azure Elastigroups
<!--end collection content-->

## Installing this collection
Expand All @@ -52,7 +53,7 @@ be manually installed using pip and from the collection project's root, running:
pip install requirements.txt
or:

pip install spotinst_sdk2>=2.1.29
pip install spotinst_sdk2>=2.1.30

## Using this collection

Expand Down
14 changes: 12 additions & 2 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
ancestor: null
releases:
1.2.0:
changes:
release_summary: Adding Azure Elastigroups support in spot.cloud_modules collection.
fragments:
- 1-2-0-summary.yml
modules:
- description: Create, update or delete Spot Azure Elastigroups
name: azure_elastigroup
namespace: ''
release_date: '2023-03-30'
1.1.0:
changes:
release_summary: New collection - adding all existing modules.
release_summary: Adding Azure Stateful Node support in spot.cloud_modules collection.
fragments:
- 1-1-0-summary.yml
modules:
- description: Create, update or delete Spot Azure Stateful Nodes
name: azure_stateful_node
namespace: ''
release_date: '2023-03-20'
release_date: '2023-03-29'
1.0.0:
changes:
release_summary: New collection - adding all existing modules.
Expand Down
1 change: 1 addition & 0 deletions docs/examples/elastigroup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* [CodeDeploy](elastigroup-code-deploy.yml)
* [Route53](elastigroup-route53.yml)
* [ElasticBeanstalk](elastigroup-elasticbeanstalk.yml)
* [Azure Elastigroup](azure-elastigroup.yaml)
<!--te-->


81 changes: 81 additions & 0 deletions docs/examples/elastigroup/azure-elastigroup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
- hosts: localhost
tasks:
- name: azure_elastigroup_sample
spot.cloud_modules.azure_elastigroup:
state: present
uniqueness_by: "id"
do_not_update:
- region
- resource_group_name
- compute.os
elastigroup:
name: "ansible-azure-elastigroup-example"
description: "a sample Azure Elastigroup created via Ansible"
region: "eastus"
resource_group_name: "AutomationResourceGroup"
capacity:
minimum: 2
maximum: 2
target: 2
health:
health_check_types: ["vmState"]
auto_healing: false
grace_period: 300
unhealthy_duration: 120
scheduling:
tasks:
- is_enabled: true
cron_expression: "* * * 1 *"
type: "scaleUp"
adjustment: 2
strategy:
draining_timeout: 300
fallback_to_od: true
revert_to_spot:
perform_at: "always"
spot_percentage: 100
signals:
- timeout: 180
type: "vmReady"
- timeout: 210
type: "vmReadyToShutdown"
compute:
os: "Linux"
zones: ["1", "2", "3"]
preferred_zones: ["1", "2"]
vm_sizes:
od_sizes: ["standard_ds1_v2", "standard_ds2_v2"]
spot_sizes: ["standard_ds1_v2", "standard_ds2_v2"]
preferred_spot_sizes: ["standard_ds1_v2"]
launch_specification:
data_disks:
- lun: 0
size_g_b: 30
type: "Standard_LRS"
image:
marketplace:
publisher: "Canonical"
version: "latest"
sku: "18.04-LTS"
offer: "UbuntuServer"
login:
user_name: "ubuntu"
ssh_public_key: <add-your-ssh-key>"
network:
resource_group_name: "AutomationResourceGroup"
virtual_network_name: "Automation-VirtualNetwork"
network_interfaces:
- is_primary: true
assign_public_ip: true
public_ip_sku: "Standard"
subnet_name: "Automation-PrivateSubnet"
enable_ip_forwarding: true
os_disk:
size: 30
type: "Standard_LRS"
shutdown_script: "VGhpcyBpcyBzaHV0ZG93biBzY3JpcHQ="
tags:
- tag_key: "Creator"
tag_value: "Ansible Test"
register: result
- debug: var=result
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: spot
name: cloud_modules

# The version of the collection. Must be compatible with semantic versioning
version: 1.1.0
version: 1.2.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
Loading

0 comments on commit 032fe70

Please sign in to comment.