Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix osp-17 overcloud node count #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions roles/openstack_undercloud/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,27 @@


# ansible_env.HOME should've worked here
- name: Get Controller Nodes number
shell: source {{ user_homedir.stdout }}/stackrc; nova list | grep controller | grep ACTIVE | wc -l
register: controller_count
when: undercloud_conf.stat.exists

- name: Get Compute Nodes number
shell: source {{ user_homedir.stdout }}/stackrc; nova list | grep compute | grep ACTIVE | wc -l
register: compute_count
when: undercloud_conf.stat.exists
- name: get overcloud node count before OSP-17
block:
- name: Get Controller Nodes number
shell: source {{ user_homedir.stdout }}/stackrc; nova list | grep controller | grep ACTIVE | wc -l
register: controller_count

- name: Get Compute Nodes number
shell: source {{ user_homedir.stdout }}/stackrc; nova list | grep compute | grep ACTIVE | wc -l
register: compute_count
when: rhosp_major is version('17', '<') and undercloud_conf.stat.exists

- name: get overcloud node count on or after OSP-17
block:
- name: Get Controller Nodes number
shell: source {{ user_homedir.stdout }}/stackrc; metalsmith list | grep controller | grep ACTIVE | wc -l
register: controller_count

- name: Get Compute Nodes number
shell: source {{ user_homedir.stdout }}/stackrc; metalsmith list | grep compute | grep ACTIVE | wc -l
register: compute_count
when: rhosp_major is version('17', '>=') and undercloud_conf.stat.exists

- name: setting fact
set_fact:
Expand Down