Skip to content

Create Ansible module for cloudbridge #311

@nuwang

Description

@nuwang

An ansible module for cloudbridge would be of great use to anyone who needs to provision VMs and other cloud resources using simple yaml templates. The template will express the desired state of the resource.

A cloudbridge ansible module for creating a VM could look like the following:

- name: launch a cloudbridge instance
  cloudbridge_instance:
    state: present
    provider:
      type: aws
      aws_access_key_id: 
      aws_secret_access_key: 
    label: vm1
    image: ami-6e649707
    vm_type: m1.small
    key_pair: my_key_pair
    vm_firewalls: []
    user_data: ""        

Similarly, for creating a keypair:

- name: create a new key_pair
  cloudbridge_key_pair:
    state: present
    provider:
      type: gcp
    name: my_new_key_pair

Or a disk:

- name: create a new volume
  cloudbridge_volume:
    state: present
    provider:
      type: azure
   label: my_volume
   size: 10
   description: my postgres volume

Each module would need to inspect the current state of the object, and drive it towards the desired state. For example, if the vm instance does not exist, it would create it. However, if the vm instance exists but only the label has changed, it would rename it.

It would be best to take a phased approach and implement services incrementally so that multiple people can work on it. The ansible modules could be split as follows:

  • Add keypair module
  • Add vm_firewall module
  • Add vm_firewall_rule module
  • Add networks module
  • Add subnet module
  • Add internet_gateway module
  • Add floating_ip module
  • Add router module
  • Add volume module
  • Add snapshot module
  • Add bucket module
  • Add bucket_object module
  • Add image module
  • Add vm_type module
  • Add instance module
  • Add dns host_zones module
  • Add dns record module

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions