Skip to content

Instantly share code, notes, and snippets.

@mbruzek
Created May 25, 2018 19:46
Show Gist options
  • Save mbruzek/000e2e6cf5a7d65ae6c7aeb877b78ec5 to your computer and use it in GitHub Desktop.
Save mbruzek/000e2e6cf5a7d65ae6c7aeb877b78ec5 to your computer and use it in GitHub Desktop.
---
- name: test the instackenv logic
hosts: localhost
vars:
num_controllers: 3
num_storage: 5
vars_prompt:
- name: "instack_url"
prompt: "What is th instackenv url?"
private: false
tasks:
- name: Get the instackenv file
uri:
url: "{{ instack_url }}"
register: instack_data
- name: Count the nodes
set_fact:
total_nodes: "{{ instack_data['json']['nodes'] | length }}"
- name: Calculate the num_compute
debug:
msg: "num_compute: {{ total_nodes | int - num_controllers | int - num_storage | int }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment