Hi, yes this works:
Thanks! this was just what I was looking for.
I made some updates and added command output to a variable which was very helpful. I'll add the rest in later:
@{
cloud = 'AWS'
Instance_type = $InstanceType
AVAIL_ZONE = 'eu-west-3a'
REGION = 'eu-west-3'
environment = 'DIT'
Support_Team = 'Win_Team'
Callout = '6-8'
my_custom_fact = 'value'
}
Which gave this output in setup:
"ansible_local": {
"AVAIL_ZONE": "eu-west-3a",
"Callout": "6-8",
"REGION": "eu-west-3",
"Support_Team": "Win_Team",
"cloud": "t2.micro",
"environment": "DIT",
"my_custom_fact": "value"
},
One last question, is it possible to make it look like this like it does on Linux (adding the filename and the [title] block)?:
"ansible_local": {
"local": {
"local_facts": {
"ami_id": "ami-0701e7be9b2a77600",
"avail_zone": "eu-west-1b",
"region": "eu-west-1",
"callout": "24-7",
"environment": "Production",
"instance_type": "t2.micro",
"support_team": "Hadoopi_Team",
"cloud": "AWS"
}
}
},
I tried to add in additional lines but it didn't like it and I'm pretty sure it's a simple fix.
Thanks again.