@Override public boolean start() { if (!CoreGlobalProperty.UNIT_TEST_ON) { asf.deployModule(FusionstorGlobalProperty.BACKUP_STORAGE_MODULE_PATH, FusionstorGlobalProperty.BACKUP_STORAGE_PLAYBOOK_NAME); } return true; }
private void deployAgent() { String script = "sudo bash /home/vyos/zvrboot.bin\n" + "sudo bash /home/vyos/zvr.bin\n" + "sudo bash /etc/init.d/zstack-virtualrouteragent restart\n"; new Ssh().setTimeout(300).scp( PathUtil.findFileOnClassPath("ansible/zvr/zvr.bin", true).getAbsolutePath(), "/home/vyos/zvr.bin" ).scp( PathUtil.findFileOnClassPath("ansible/zvr/zvrboot.bin", true).getAbsolutePath(), "/home/vyos/zvrboot.bin" ).scp( PathUtil.findFileOnClassPath("ansible/zvr/version", true).getAbsolutePath(), "/home/vyos/zvr/version" ).setPrivateKey(asf.getPrivateKey()).setUsername("vyos").setHostname(mgmtNicIp).setPort(22).runErrorByExceptionAndClose(); new Ssh().shell( script ).setTimeout(300).setPrivateKey(asf.getPrivateKey()).setUsername("vyos").setHostname(mgmtNicIp).setPort(22).runErrorByExceptionAndClose(); trigger.next(); }
boolean changed = asf.isModuleChanged(playBookName); if (changed) { logger.debug(String.format("ansible module[%s] changed, run ansible", playBookName));
"exit 0" ).formatByMap(map( e("pubkey", asf.getPublicKey()) ));
private void configAgentSsh() { Boolean passwordAuth = VirtualRouterGlobalConfig.SSH_LOGIN_PASSWORD.value(Boolean.class); String script; if (!passwordAuth) { script = "sudo sed -i \"/PasswordAuthentication /c PasswordAuthentication no\" /etc/ssh/sshd_config\n"+ "sudo service ssh restart\n"; } else { script = " sudo sed -i \"/PasswordAuthentication /c PasswordAuthentication yes\" /etc/ssh/sshd_config\n"+ "sudo service ssh restart\n"; } new Ssh().shell( script ).setTimeout(300).setPrivateKey(asf.getPrivateKey()).setUsername("vyos").setHostname(mgmtNicIp).setPort(22).runErrorByExceptionAndClose(); trigger.next(); }
if (!asf.isModuleChanged(KVMConstant.ANSIBLE_PLAYBOOK_NAME)) { return;
String publicKey = asf.getPublicKey(); ret.put(ApplianceVmConstant.BootstrapParams.publicKey.toString(), publicKey); ret.put(BootstrapParams.sshPort.toString(), sshPort);
private void deployAnsible() { if (CoreGlobalProperty.UNIT_TEST_ON) { return; } asf.deployModule(VirtualRouterConstant.ANSIBLE_MODULE_PATH, VirtualRouterConstant.ANSIBLE_PLAYBOOK_NAME); }
private void handle(final GetSftpBackupStorageDownloadCredentialMsg msg) { final GetSftpBackupStorageDownloadCredentialReply reply = new GetSftpBackupStorageDownloadCredentialReply(); String key = asf.getPrivateKey(); reply.setHostname(getSelf().getHostname()); reply.setUsername(getSelf().getUsername()); reply.setSshKey(key); reply.setSshPort(getSelf().getSshPort()); bus.reply(msg, reply); }
private void deploySaltState() { if (CoreGlobalProperty.UNIT_TEST_ON) { return; } asf.deployModule(SftpBackupStorageConstant.ANSIBLE_MODULE_PATH, SftpBackupStorageConstant.ANSIBLE_PLAYBOOK_NAME); }
final String privKey = asf.getPrivateKey(); final String mgmtIp = mgmtNic.getIp();
@Override public boolean start() { if (!CoreGlobalProperty.UNIT_TEST_ON) { asf.deployModule(CephGlobalProperty.BACKUP_STORAGE_MODULE_PATH, CephGlobalProperty.BACKUP_STORAGE_PLAYBOOK_NAME); } return true; }
final String privKey = asf.getPrivateKey();
private void deployAnsibleModule() { if (CoreGlobalProperty.UNIT_TEST_ON) { return; } asf.deployModule(KVMConstant.ANSIBLE_MODULE_PATH, KVMConstant.ANSIBLE_PLAYBOOK_NAME); }
private void handle(GetKVMHostDownloadCredentialMsg msg) { final GetKVMHostDownloadCredentialReply reply = new GetKVMHostDownloadCredentialReply(); String key = asf.getPrivateKey(); String hostname = null; if (Strings.isNotEmpty(msg.getDataNetworkCidr())) { String dataNetworkAddress = getDataNetworkAddress(self.getUuid(), msg.getDataNetworkCidr()); if (dataNetworkAddress != null) { hostname = dataNetworkAddress; } } reply.setHostname(hostname == null ? getSelf().getManagementIp() : hostname); reply.setUsername(getSelf().getUsername()); reply.setSshPort(getSelf().getPort()); reply.setSshKey(key); bus.reply(msg, reply); }
@Override public boolean start() { if (!CoreGlobalProperty.UNIT_TEST_ON) { asf.deployModule(CephGlobalProperty.PRIMARY_STORAGE_MODULE_PATH, CephGlobalProperty.PRIMARY_STORAGE_PLAYBOOK_NAME); } return true; }
final String privKey = asf.getPrivateKey(); final String username = "root"; final int sshPort = 22;
private void deploySaltState() { if (CoreGlobalProperty.UNIT_TEST_ON) { return; } asf.deployModule("ansible/consoleproxy", ANSIBLE_PLAYBOOK_NAME); }
private void deployAnsible() { if (CoreGlobalProperty.UNIT_TEST_ON) { return; } asf.deployModule(ApplianceVmConstant.ANSIBLE_MODULE_PATH, ApplianceVmConstant.ANSIBLE_PLAYBOOK_NAME); }
@Override public boolean start() { if (!CoreGlobalProperty.UNIT_TEST_ON) { asf.deployModule(FusionstorGlobalProperty.PRIMARY_STORAGE_MODULE_PATH, FusionstorGlobalProperty.PRIMARY_STORAGE_PLAYBOOK_NAME); } startCleanupThread(); FusionstorGlobalConfig.IMAGE_CACHE_CLEANUP_INTERVAL.installUpdateExtension(new GlobalConfigUpdateExtensionPoint() { @Override public void updateGlobalConfig(GlobalConfig oldConfig, GlobalConfig newConfig) { if (imageCacheCleanupThread != null) { imageCacheCleanupThread.cancel(true); } startCleanupThread(); } }); return true; }