Code Monkey home page Code Monkey logo

ansible-cloudstack's Introduction

Ansible CloudStack Modules

Manages resources on Apache CloudStack, Citrix CloudPlatform and Exoscale.

NOTE: Since Ansible 2.1 was released, I don't see any more need to maintain this repo for Ansible 1.9. I mark this repo as deprecated with the next Ansible major release 2.2

Difference of CloudStack modules in ansible-modules-extras and this repo?

This repo has been made for simple using CloudStack modules while ansible 2.0 is not yet released. I maintain the CloudStack modules in ansible-modules-extras as well and I am in charge to keep them in sync.

This means they are 100% compatible.

If you like to contribute, it would be fine to make PRs here first. After acceptance you should also make a PR to ansible-modules-extras (or let me know if I should do it.)

AnsibleCloudStack (called utils) in upstream Ansible is located in ansible repo here and will be imported in ansible-modules-extras (once ansible 2.0 is released).

I also sync changes between the utils in upstream ansible and ansible_cloudstack_utils.py, but unfortunately I didn't find a way to import ansible_cloudstack_utils.py in the module here.

(If you know how this would be possible I would be more then happy).

That is why I just copied it into the modules. Same here, if you make changes to utils make it in ansible_cloudstack_utils.py and I will spread it to all modules (I have my tools ready for doing this).

Requirements

Uses Exosclale's python cs library: sudo pip install cs

Note: You can pass the API credentials by module arguments api_url, api_key and api_secret or even more comfortable by cloudstack.ini. Please see the https://github.com/exoscale/cs for more information.

Examples

# Upload an ISO (Note: this should have CloudStack SSH PubKey handling installed):
- local_action:
     module: cs_iso:
     name: Debian 7 64-bit
     url: http://iso.example.com/debian-cd/7.7.0/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso
     os_type: Debian GNU/Linux 7(64-bit)
     checksum: 0b31bccccb048d20b551f70830bb7ad0


# Upload your SSH public key
- local_action:
    module: cs_sshkeypair
    name: [email protected]
    public_key: '{{ lookup('file', '~/.ssh/id_rsa.pub') }}'


# Ensure security group default exists
- local_action: 
    module: cs_securitygroup
    name: default


# Add inbound tcp rules to security group default
- local_action: 
    module: cs_securitygroup_rule
    security_group: default
    start_port: '{{ item }}'
    end_port: '{{ item }}'
  with_items:
  - 80
  - 8089


# Create a virtual machine on CloudStack
- local_action:
    module: cs_instance
    name: web-vm-1
    iso: Linux Debian 7 64-bit
    hypervisor: VMware
    service_offering: Tiny
    disk_offering: Performance
    disk_size: 20
    ssh_key: [email protected]


# Make a snapshot
- local_action:
    module: cs_vmsnapshot
    name: Snapshot before upgrade
    vm: web-vm-1
    snapshot_memory: yes


# Change service offering on existing VM
- local_action:
    module: cs_instance
    name: web-vm-1
    service_offering: Medium


# Stop a virtual machine
- local_action:
    module: cs_instance
    name: web-vm-1
    state: stopped


# Start a virtual machine
- local_action: cs_instance name=web-vm-1 state=started


# Remove a virtual machine on CloudStack
- local_action: cs_instance name=web-vm-1 state=absent

ansible-cloudstack's People

Contributors

resmo avatar atsaki avatar milamberspace avatar bbaassssiiee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.