protected function writeHostVarsFile($inventoryFolder, $ipAddress, $vars)
{
// what are we doing?
$log = usingLog()->startAction("write host_vars file for '{$ipAddress}'");
// what is the path to the file?
$filename = $this->getHostVarsFilename($inventoryFolder, $ipAddress);
// does the target folder exist?
$hostVarsFolder = dirname($filename);
if (!file_exists($hostVarsFolder)) {
mkdir($hostVarsFolder);
}
// write the data
usingYamlFile($filename)->writeDataToFile($vars);
// all done
$log->endAction("written to file '{$filename}'");
}