createResourceYaml to return nodes dict, write to yaml

1. Updated createResourceYaml to return the nodes dict rather than return 0 on success.
    This dict will be used to configure fab itself (to define role defs).
2. made yaml file write conditional - only write to file if file_path is set.
3. Made append to yaml file parameterized.