trying with local action
This commit is contained in:
parent
9532b9953e
commit
da2cd67f25
1 changed files with 20 additions and 15 deletions
|
@ -26,22 +26,27 @@
|
|||
|
||||
|
||||
- name: spin UP VM using nova_compute
|
||||
delegate_to: 127.0.0.1
|
||||
nova_compute:
|
||||
# insecure: True
|
||||
auth_url: "{{OS_AUTH_URL}}"
|
||||
login_username: "{{OS_USERNAME}}"
|
||||
login_password: "{{OS_PASSWORD}}"
|
||||
login_tenant_name: "{{OS_TENANT_NAME}}"
|
||||
name: "{{inventory_hostname}}"
|
||||
image_id: "{{ image }}"
|
||||
wait_for: 300
|
||||
flavor_id: "{{ flavor_id }}" # TODO: conversion from `instance_type`
|
||||
security_groups: "{{security_group}}"
|
||||
key_name: "{{ keypair }}"
|
||||
floating_ips:
|
||||
- "{{public_ip}}"
|
||||
local_action: "nova_compute insecure=True auth_url={{OS_AUTH_URL}} login_username={{OS_USERNAME}} login_password={{OS_PASSWORD}} login_tenant_name={{OS_TENANT_NAME}} name={{inventory_hostname}} image_id={{ image }} wait_for=300 flavor_id={{ flavor_id }} security_groups={{security_group}} key_name={{keypair}}"
|
||||
register: nova_result
|
||||
|
||||
|
||||
#- name: spin UP VM using nova_compute
|
||||
# delegate_to: 127.0.0.1
|
||||
# nova_compute:
|
||||
# # insecure: True
|
||||
# auth_url: "{{OS_AUTH_URL}}"
|
||||
# login_username: "{{OS_USERNAME}}"
|
||||
# login_password: "{{OS_PASSWORD}}"
|
||||
# login_tenant_name: "{{OS_TENANT_NAME}}"
|
||||
# name: "{{inventory_hostname}}"
|
||||
# image_id: "{{ image }}"
|
||||
# wait_for: 300
|
||||
# flavor_id: "{{ flavor_id }}" # TODO: conversion from `instance_type`
|
||||
# security_groups: "{{security_group}}"
|
||||
# key_name: "{{ keypair }}"
|
||||
# floating_ips:
|
||||
# - "{{public_ip}}"
|
||||
# register: nova_result
|
||||
# when: vm_status.stdout != "ACTIVE"
|
||||
|
||||
# - debug: msg="{{ nova_result.info }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue