Exemplo n.º 1
0
 /**
  * @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}'");
 }
Exemplo n.º 2
0
 /**
  * @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();
 }