Hi,

I've been stuck on this issue for a few days and I'm still unable to make 
it work, even though it should be doable. Essentially, I'm doing a shell 
command which gives me the following return (please don't suggest to use an 
ansible module for this, the ansible module and shade don't support 
choosing the subnet when associating a floatingip)


   1. "stdout_lines": [
   2.             "Created a new floatingip:", 
   3.             
   "+---------------------+--------------------------------------+", 
   4.             "| Field               | Value                           
        |", 
   5.             
   "+---------------------+--------------------------------------+", 
   6.             "| created_at          | 2018-02-19T09:32:44Z             
       |", 
   7.             "| description         |                                 
        |", 
   8.             "| fixed_ip_address    | 10.80.16.60                     
        |", 
   9.             "| floating_ip_address | 192.168.0.1                     
      |", 
   10.             "| floating_network_id | uuid |", 
   11.             "| id                  | uuid |", 
   12.             "| port_id             | uuid |", 
   13.             "| project_id          | uuid     |", 
   14.             "| revision_number     | 1                               
        |", 
   15.             "| router_id           | uuid |", 
   16.             "| status              | DOWN                           
         |", 
   17.             "| tenant_id           | uuid     |", 
   18.             "| updated_at          | 2018-02-19T09:32:44Z           
         |", 
   19.             
   "+---------------------+--------------------------------------+
   

Essentially, I want to extract the floating_ip_address line. So, I've been 
using a commonly recognized regex for IP address and, right now, I've 
reached the point where I have the following line:


   1. - name: extract the ip line
   2.   set_fact:
   3.     regexcomp: "{{ rawfloating.stdout_lines | 
   regex_search('floating_ip_address \\| 
   \\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b') }}"
   
Now ansible tells me that it's expecting a string or buffer. I'm not sure 
what to do anymore. Anyone has any ideas?

-- 
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/643e34e6-416f-44b2-8e96-a72ef14b2e25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to