App Blueprint to provision simple lab environment

Hi All,

Im looking to create a App Blueprint that contains a Windows Domain Controller and a Windows member server.

I have the Domain Controller in Tier1 and the member server in Tier 2 in the blueprint , I have ticked the connected tiers checkbox to link tier 1 and 2 together.

All I need to do is pass the IP Address of the domain controller to the member server in Tier 2 so it can use it as its DNS server IP. I can then run the workflow to add it to the domain. I cant seem to get this to work.

I have tried using the suggestions in this YAML which I got from ChatGPT but the DNS IP doesn’t apply. The Domain Controller is in the Database Tier and the Member Server in the App Tier. I hoping this is pretty straightforward and if I can get it to work its going to open up a whole new level of automation for us. What am I missing here?, Would it be easier to do this with terraform or Ansible?

tiers:
App:
linkedTiers:
- Database
tierIndex: 2 # Adjusted tierIndex to ensure Database is provisioned first
tier:
bootOrder: 1
lockedFields:
- bootOrder
instances:
- instance:
name: Lab1
type: SM_WINDOWS
environments:
Dev:
groups:
UKSouth-SM:
clouds:
UKSouth-01:
cloud:
id: 39
linkedVariables:
- name: database_dns_ip
link: link(“#{tier1.Database.networkInterfaces[0].ip}”)
# Additional AppTier configuration details…

Database:
tierIndex: 1 # Adjusted tierIndex to ensure Database is provisioned first
instances:
- instance:
name: LAB1
type: SM_WINDOWS
environments:
Dev:
groups:
UKSouth-SM:
clouds:
UKSouth-01:
cloud:
id: 39
variables:
- name: dns_ip
value: “#{instance.networkInterfaces[0].ip}” # Reference the IP dynamically
# Additional DatabaseTier configuration details…

In a blueprint the way to share configuration information between the tiers is through the user of environment variables or evars. I believe you can find a similar example to your use case which uses evars in this guide.

https://docs.morpheusdata.com/en/latest/getting_started/guides/autoinstall_app.html#create-application-install-and-apache-restart-tasks

You can also achieve this in a single Instance configuration using multiple node types, and the post provision workflow. A post provision workflow will only execute once all nodes within an instance have finished provisioning (and IP address information up to date).

Continue with the blueprint approach for now. One thing you should explore is all the automation variables available to you in a workflow using the approach discussed here: Listing variables in Morpheus

You will most likely find the data you need and the variable to use to access it. The ‘app’ variable may be of interest for example.

Thanks both, ill stick with it and keep you updated

Just a quick question about evars, how do I update an evar value from within a task?

IP and Host seem to get created automatically , i have a third custom named evar that I have no idea how to update the value.

Thanks

Hi guys,

Any idea how to update environment variables?

If not then what’s the best way to create a variable that can be shared between all instances in the app?

I’ve been thinking about writing to the Wiki but that doesn’t feel right.

Any ideas?

Thanks

Hi Kevin,

from the below API call we can create or update the existing evars of an instance.

/api/instances/{id}/envs
method : POST
{
“envs”: [
{
“name”: “vstest3”,
“value”: “false”,
“export”: false,
“masked”: false
}
]
}