Created
May 25, 2018 19:46
-
-
Save mbruzek/000e2e6cf5a7d65ae6c7aeb877b78ec5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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