GithubHelp home page GithubHelp logo

ansible-cloudstack's People

Contributors

atsaki avatar bbaassssiiee avatar milamberspace avatar resmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-cloudstack's Issues

Problem specifying disk size on exoscale

Hi @resmo looks like we can't specify disk size on exoscale:

this:

  - name: Start head-node VM
    local_action:
      module: cloudstack_vm
      name: head-node1
      template: Linux Ubuntu 14.04 LTS 64-bit 10G Disk (2014-10-28-3b8b26) 
      service_offering: Tiny

Gives an unknown template error. But I I use Linux Ubuntu 14.04 LTS 64-bit and

disk_size: 10

It has no effect.

that's due to the naming convention of the exoscale template, which hard codes the disk sizes.

Any chance to check that ?

cs_loadbalancer_rule_member fails when rules have similar names

I'm hitting the error More than one rule having name lb_group_worker-http. Please pass 'ip_address' as well., even though I'm already passing the IP address and there is only a single rule with this name.
There is a second loadbalancer rule with a similar name, however: lb_group_worker-https

Other rules with more unique names (like lb_group_master) work fine.

It looks like the CloudStack API does not match rule names exactly, as it should.

Add usersecuritygrouplist in cloudstack_sg_rule

Hi @resmo any chance you could add the usersecuritygrouplist variable in the cloudstack_sg_rule file.
It allows to create a rule where the source is another security group (without passing a cidr as source).

its very helpful for exoscale.

thanks

Issue with staticnat and CloudStack 4.5: NameError: global name 'AnsibleCloudStackPortforwarding' is not defined

TASK: [cs_staticnat] **********************************************************
failed: [127.0.0.1 -> 127.0.0.1] => {"failed": true, "parsed": false}
Traceback (most recent call last):
File "/home/milamber/.ansible/tmp/ansible-tmp-1440009370.83-101564793180131/cs_staticnat", line 2280, in
main()
File "/home/milamber/.ansible/tmp/ansible-tmp-1440009370.83-101564793180131/cs_staticnat", line 657, in main
acs_static_nat = AnsibleCloudStackStaticNat(module)
File "/home/milamber/.ansible/tmp/ansible-tmp-1440009370.83-101564793180131/cs_staticnat", line 525, in init
super(AnsibleCloudStackPortforwarding, self).init(module)
NameError: global name 'AnsibleCloudStackPortforwarding' is not defined

sshkeypair not checking finger print

It only check the name currently. Given we know the public key during runtime, we should be able to generate the finger print and use that in the query other than the name. Not sure how easy was it to do it in Python though.

Best,

Dong

installation

Great work, thanks a lot for this.

Where do I put this if I have my own ansible installation (meaning I install ansible from source) ?

thanks

Add usersecuritygrouplist in cloudstack_sg_rule

Hi @resmo any chance you could add the usersecuritygrouplist variable in the cloudstack_sg_rule file.
It allows to create a rule where the source is another security group (without passing a cidr as source).

its very helpful for exoscale.

thanks

URL encode doesn't work?!

Did you ever try register ISO with a URL?

I got an error like this:

TASK: [test] ****************************************************************** 
failed: [localhost -> 127.0.0.1] => {"failed": true}
msg: CloudStackException: ('HTTP 431 response from CloudStack', <Response [431]>, {u'errorcode': 431, u'uuidList': [], u'cserrorcode': 9999, u'errortext': u'Unsupported scheme for url: http%3A%2F%2Fstable.release.core-os.net%2Famd64-usr%2Fcurrent%2Fcoreos_production_iso_image.iso'})

I did try cloudmonkey and it works. Seems the endpoint doesn't like this kind of encoding?

Best,

Dong

cloudstack_sshkey error

Seems you removed the following two lines:

    result = {}
    result['changed'] = False

before

    state = module.params.get('state')

Now we get errors like this:

File "/home/dong/.ansible/tmp/ansible-tmp-1426522421.37-197318843812041/cloudstack_sshkey", line 294, in get_result
    self.result['fingerprint'] = ssh_key['fingerprint']
AttributeError: AnsibleCloudStackSshKey instance has no attribute 'result'

Userdata support in cloudstack_vm

@resmo thanks for your hard work on this. It's super useful
The sg, sg rules and cloudstack_vm works.

It would be great to add userdata support in the cloudstack_vm module. something like

- local_action:
  module: cloudstack_vm
  name: foobar
  userdata: /path/to/userdata

Multiple environments

Hi René.
I can't find documentation on how to support multiple environments. It would be nice if we could use the inventory list with a list of "independent management servers", and have the module search the respective cloudstack.ini .... is it supported, or am I missing something?

Type back,
-NT

Add support for generating additional groups based on hostname

Cloudstack only stores a limited amount of grouping information.
For example, it is not possible to assign multiple host groups to a host.

This script can be used alongside cloudstack.py to generate additional groups based on hostname regex matches:

import sys
import json
import re

hosts = json.load(sys.stdin)

for host in hosts['all']['hosts']:
    for check in sys.argv[1:]:
        (group, sep, rex) = check.partition('=')
        #print >> sys.stderr, "{} ? {} -> {}".format(host, rex, group)
        if rex and re.search(rex, host):
            #print >> sys.stderr, "{} -> {}".format(host, group)
            if group not in hosts:
                hosts[group] = {
                    'hosts': []
                }
            hosts[group]['hosts'].append(host)

print(json.dumps(hosts, indent=2))

It would be nice to have this feature added to cloudstack.py, for example with a multi-option like --hostgroup <group_name>=<regex>

Question: Destroy and Expunge

A simple question: currently it seems setting state to Expunged won't work, Ansible detected the change yet the VM is still happily living.

We will get this error msg if we try 'expunge' command from cs or cloudmonkey on a running VM:

Error 530, Please destroy vm with specified vmId before expunge

Does that mean in order to totally remove a VM, we need to have two tasks: first destroy then expunge?

At least in the API for command 'destroy virtualmachine' we can give a parameter 'expunge=true'. I understand this is purely a design issue. Not sure how would Ansible philosophy handle this.

Time out with maximum retries reached

On a cloudstack cloud with an advanced zone we see lots of HTTPS errors due to maximum connection retries reached.

While it might be a setup/limit issue on the cloud. Is there a way to configure Ansible to avoid those issues, increase the time during polls on the API ?

This error is seen with a simple play that starts a single instance. the instance actually starts but the play fails. So ansible has to be doing multiple cs polls. to get the status of the VM (async, job status poll).

skip creating sec group if already created

Hi @resmo shouldn't ansible skip a task if it's already created (idempotent…).

When I create a security group that has already been created, I see the cloudstack error:

failed: [localhost -> 127.0.0.1] => {"failed": true}  
msg: CloudStackException: ('HTTP 431 response from CloudStack', <Response [431]>, {u'errorcode': 431, u'uuidList': [], u'cserrorcode': 4350, u'errortext': u'Unable to create security group, a group with name foobar already exisits.'})

FATAL: all hosts have already failed -- aborting

I am sure there is an easy way in ansible to skip through this ?

"No networks available" error

I try to create firewall rule, I always have this error : "No networks available" but the rule is created.

Here is my playbook :

- hosts: all
  sudo: no
  gather_facts: no
  connection: local
  tasks:
    - cs_firewall:
        ip_address: 178.170.72.99
        start_port: 1234
        end_port: 1234
        cidr: 17.0.0.0/8
        state: present

Ansible does not fail when an ISO cannot be removed

When using state: absent to remove an ISO image, cs_iso will always report a changed state, but it does not fail if the image can't be removed.

This can occur when the image is still attached to a virtual machine, for example.

My python-cs is version 0.8.2.

Problem when there is a mix of tcp and icmp rules

Hi @resmo I am still looking into it, but there seems to be a bug when you try to add rules to a sec group that are from different protocols.

Say you add a ssh rule and then an icmp rule….it won't work. or so it seems.
I am looking at the code right now.

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.