change fab function to return the nodes dict, write to yaml if required

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