/** * @param string $inventoryFolder */ 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}'"); }
/** * @param array $vars */ protected function writeDsbuildParamsYamlFile($vars) { // what are we doing? $log = usingLog()->startAction("write dsbuildparams.yml"); // what is the path to the file? $filename = "dsbuildparams.yml"; // write the data usingYamlFile($filename)->writeDataToFile($vars); // all done $log->endAction(); }