You can use configs.sh for this
https://cwiki.apache.org/confluence/display/AMBARI/Modify+configurations
/var/lib/ambari-server/resources/scripts/configs.sh set localhost cl1 cluster-env "myproperty" "myvalue"
########## Performing 'set' myproperty:myvalue on (Site:cluster-env, Tag:version1)
########## PUTting json into: doSet_version1459927360931285086.json
########## NEW Site:cluster-env, Tag:version1459927360931285086