HPE Morpheus Enterprise
1833163 Members
3658 Online
110051 Solutions
New Discussion

Get the correct address dynamically using morpheus variables

 
Not applicable

Get the correct address dynamically using morpheus variables

Hi,

I’m currently trying to get a blueprint to work, hence I want to make a distributed MERN stack, 1st I provision a VM let’s say called (database), then another VM (backend)

I’m using Ansible playbooks to automate the installations, however when on the second VM (backend) provisioning I need to pick the 1st provisioned VM (database) address

I tried using something like (below) but had no luck, I’m not sure if possible to get it dynamically or so…
**

database_host_address : “{{ morpheus[‘instance’][‘containers’] | selectattr(‘hostname’, ‘equalto’, ‘database’) | map(attribute=‘externalIp’) | first }}”

**

appreciate the feedback! thanks