Do it in jq, but see @Kusalananda's answer first
jq -r '.host_components[].HostRoles.host_name | join(",")'
No, that's wrong. This is what you need:
jq -r '.host_components | map(.HostRoles.host_name) | join(",")'
Demo:
jq -r '.host_components | map(.HostRoles.host_name) | join(",")' <<DATA
{"host_components":[
{"HostRoles":{"host_name":"one"}},
{"HostRoles":{"host_name":"two"}},
{"HostRoles":{"host_name":"three"}}
]}
DATA
outputs
one,two,three