Git Product home page Git Product logo

Comments (1)

nathanhammond avatar nathanhammond commented on May 20, 2024
diff --git a/roles/cloud-openstack/tasks/main.yml b/roles/cloud-openstack/tasks/main.yml
index ac6cbd3..0796e8e 100644
--- a/roles/cloud-openstack/tasks/main.yml
+++ b/roles/cloud-openstack/tasks/main.yml
@@ -16,7 +16,7 @@
 - name: Security rules created
   openstack.cloud.security_group_rule:
     state: "{{ state|default('present') }}"
-    security_group: "{{ os_security_group.id }}"
+    security_group: "{{ os_security_group.security_group.id }}"
     protocol: "{{ item.proto }}"
     port_range_min: "{{ item.port_min }}"
     port_range_max: "{{ item.port_max }}"
@@ -40,7 +40,7 @@
 - name: Set image as a fact
   set_fact:
     image_id: "{{ item.id }}"
-  loop: "{{ os_image.openstack_image }}"
+  loop: "{{ os_image.images }}"
   when:
     - item.name == cloud_providers.openstack.image
     - item.status == "active"
@@ -56,12 +56,12 @@
     - item['router:external']|default(omit)
     - item['admin_state_up']|default(omit)
     - item['status'] == 'ACTIVE'
-  with_items: "{{ os_network.openstack_networks }}"
+  with_items: "{{ os_network.networks }}"
 
 - name: Set facts
   set_fact:
-    flavor_id: "{{ (os_flavor.openstack_flavors | sort(attribute='ram'))[0]['id'] }}"
-    security_group_name: "{{ os_security_group['secgroup']['name'] }}"
+    flavor_id: "{{ (os_flavor.flavors | sort(attribute='ram'))[0]['id'] }}"
+    security_group_name: "{{ os_security_group['security_group']['name'] }}"
 
 - name: Server created
   openstack.cloud.server:
@@ -75,8 +75,15 @@
       - net-id: "{{ public_network_id }}"
   register: os_server
 
+- name: Set the IPv4 as a fact
+  set_fact:
+    cloud_instance_ip: "{{ item.addr }}"
+  when:
+    - item['version'] == 4
+  with_items: "{{ os_server.server.addresses.public }}"
+
+
 - set_fact:
-    cloud_instance_ip: "{{ os_server['openstack']['public_v4'] }}"
     ansible_ssh_user: algo
     ansible_ssh_port: "{{ ssh_port }}"
     cloudinit: true

from algo.

Related Issues (20)

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.