Skip to content

Commit 1cddc5f

Browse files
committed
Change the way the ssh command is provided.
1 parent cee87a5 commit 1cddc5f

File tree

2 files changed

+13
-41
lines changed

2 files changed

+13
-41
lines changed

multinode-app.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,10 @@
9191
# - name: Deploy OpenStack.
9292
# ansible.builtin.shell:
9393
# cmd: "./deploy-openstack.sh"
94+
95+
- hosts: localhost
96+
tasks:
97+
- debug: var=outputs
98+
vars:
99+
outputs:
100+
cluster_access_ip: "{{ hostvars[groups['openstack'][0]].cluster_gateway_ip }}"

ui-meta/multinode-infra-appliance.yml

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -167,44 +167,9 @@ usage_template: |-
167167
168168
To assess the clusters, use the following ssh commands:
169169
170-
{% for group in cluster_nodes|groupby('groups') %}
171-
# {{ group.0|upper|bold }}
172-
{% for node in group.1 %}
173-
{% if node.ip is defined %}
174-
{% if node.ip != '' %}
175-
# {{ node.name|bold }}
176-
{% if node.groups[0] == "ansible_control" %}
177-
{% set status = "READY" %}
178-
{% else %}
179-
{% set status = "NOT AVAILABLE" %}
180-
{% endif %}
181-
# Instance name from {{ node.groups[0]|capitalize }} => {{ status|green if status == "READY" else status|red }} -> ssh {{ ssh_user }}@{{ node.ip }}
182-
{% endif %}
183-
{% endif %}
184-
{% else %}
185-
# Web service is not ready yet.
186-
{% endfor %}
187-
{% endfor %}
188-
189-
# METHOD 2
190-
# Accessing the cluster
191-
192-
To assess the clusters, use the following ssh commands:
193-
194-
{% for group in cluster_nodes|groupby('groups') %}
195-
# {{ group.grouper|upper }}
196-
{% for node in group.list %}
197-
{% if node.ip is defined and node.ip != '' %}
198-
# {{ node.name }}
199-
{% if node.groups[0] == "ansible_control" %}
200-
{% set status = "READY" %}
201-
{% else %}
202-
{% set status = "NOT AVAILABLE" %}
203-
{% endif %}
204-
# Instance name from {{ node.groups[0]|capitalize }} => {{ status }} -> ssh {{ node.variables.ansible_user }}@{{ node.ip }}
205-
{% else %}
206-
# Instance name from {{ node.groups[0]|capitalize }} => NOT AVAILABLE -> ssh {{ node.variables.ansible_user }}@{{ node.ip }}
207-
{% endif %}
208-
{% endfor %}
209-
________________________________________
210-
{% endfor %}
170+
{% if cluster.outputs.cluster_access_ip %}
171+
{% set status = "READY" %}
172+
{% else %}
173+
{% set status = "NOT READY" %}
174+
{% endif %}
175+
Ansible Control Host => {{ status|green if status == "READY" else status|red }} -> ssh {{ ssh_user }}@{{ cluster.outputs.cluster_access_ip }}

0 commit comments

Comments
 (0)