Hi All,

My Rackspace cloud servers are under managed services and under RackConnect 
services. This means than when they are built, first 2 other scripts need 
to run before I can actually use the server to provision it.

The peculiar thing is that during the RackConnect script the public ip of 
the server changes, so it in validates the data you "register" using the 
rax module when adding a server.

The fact is that we do not know precise when these build scripts have 
finished running. The only way to figure it out is either through the 
presence of a file in the servers /tmp directory or by querying the fact 
data received through the rackspace api. It should have a NVP set in the 
metatags field.

So basically what I want to do is:

- create cloud server
- poll factsdata until certain values are set
- provision the server

The documentation of the rax_facts module does not provide a lot of info, 
event when copying the sample is fails due to "{{ rax_accessipv4 }}" not 
existing...

So who can help me out here or me into the right direction?

My current playbook:
- name: Wait for Rackspace Managed Service provisioning completion
  hosts: raxtest
  gather_facts: False
  remote_user: root
  tasks:
  - name: Get meta data and check for completion of setup
    local_action:
        module: rax_facts
        api_key: <hidden>
        username: <hidden>
        register: result
        name: "{{ inventory_hostname }}"
        set_fact: managed_done = 
"{{rax_metadata.rax_service_level_automation}}"
        set_fact: ansible_ssh_host = "{{ rax_accessipv4 }}"
        until: managed_done = "Complete"
        retries: 20
        delay: 30



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f64bc273-bb58-41d0-9879-91a4d2ecf3a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to