Skip to content

Instantly share code, notes, and snippets.

View jugatsu's full-sized avatar

Anton Kvashenkin jugatsu

View GitHub Profile
virtualbox-ovf: A system shutdown is in progress.(1115)
2017/03/14 10:28:04 ui: virtualbox-ovf: A system shutdown is in progress.(1115)
2017/03/14 10:28:04 packer: 2017/03/14 10:28:04 Reboot already in progress, waiting...
2017/03/14 10:28:14 packer: 2017/03/14 10:28:14 Check if machine is rebooting...
2017/03/14 10:28:16 packer: 2017/03/14 10:28:16 [INFO] starting remote command: shutdown.exe -f -r -t 60
2017/03/14 10:28:23 ui: virtualbox-ovf: A system shutdown is in progress.(1115)
virtualbox-ovf: A system shutdown is in progress.(1115)
2017/03/14 10:28:23 packer: 2017/03/14 10:28:23 [INFO] command 'shutdown.exe -f -r -t 60' exited with code: 1115
2017/03/14 10:28:23 packer: 2017/03/14 10:28:23 [INFO] RPC endpoint: Communicator ended with: 1115
2017/03/14 10:28:23 [INFO] 0 bytes written for 'stdout'
Function Install-PSWindowsUpdate {
$webDeployURL="https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc/file/41459/43/PSWindowsUpdate.zip"
$zipPath="$($env:USERPROFILE)\Downloads\PSWindowsUpdate.zip"
$targetDir="C:\Windows\System32\WindowsPowerShell\v1.0\Modules\"
$explorerExe = "$env:windir\explorer.exe"
$FileExists = Test-Path $explorerExe
Write-Output "Starting PSWindowsUpdate module installation`n"
---
driver:
name: vagrant
linked_clone: true
provisioner:
name: chef_zero
require_chef_omnibus: true
always_update_cookbooks: true
retry_on_exit_code:
Generated at 2017-03-31 10:43:47 -0700
Chef::Exceptions::Win32APIError: windows_user[test] (test::default line 7) had an error: Chef::Exceptions::Win32APIError: Не найдено имя группы.
---- Begin Win32 API output ----
System Error Code: 2220
System Error Message: Не найдено имя группы.
---- End Win32 API output ----
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/win32/error.rb:81:in `raise!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/win32/net.rb:204:in `net_local_group_add_member'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/util/windows/net_user.rb:115:in `add'
Starting Chef Client, version 12.19.36
[2017-03-31T10:43:00-07:00] INFO: *** Chef 12.19.36 ***
[2017-03-31T10:43:00-07:00] INFO: Platform: i386-mingw32
[2017-03-31T10:43:00-07:00] INFO: Chef-client pid: 1996
Creating a new client identity for tasks-windows-hyper-v-2016 using the validator key.
[2017-03-31T10:43:45-07:00] INFO: Client key C:\Users\vagrant\AppData\Local\Temp\kitchen\client.pem is not present - registering
[2017-03-31T10:43:46-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/tasks-windows-hyper-v-2016
[2017-03-31T10:43:46-07:00] INFO: Setting the run_list to ["recipe[test::default]"] from CLI options
[2017-03-31T10:43:46-07:00] INFO: Run List is [recipe[test::default]]
[2017-03-31T10:43:46-07:00] INFO: Run List expands to [test::default]
Converging <tasks-windows-hyper-v-2016>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 5.6.0...
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
-----> Chef Omnibus installation detected (install only if missing)
Transferring files to <tasks-windows-hyper-v-2016>
Starting Chef Client, version 12.19.36
@rem
@rem Author:: Seth Chisamore (<[email protected]>)
@rem Copyright:: Copyright (c) 2011-2016 Chef Software, Inc.
@rem License:: Apache License, Version 2.0
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
ak@ak-pc:~$ tree code/chef/cookbooks/gf_chef_client/
code/chef/cookbooks/gf_chef_client/
├── attributes
│   └── default.rb
├── Berksfile
├── Berksfile.lock
├── chefignore
├── metadata.rb
├── recipes

Самостоятельное задание

Исследовать способ подключения к internalhost в одну команду из вашего рабочего устройства, проверить работоспособность найденного решения и отписать вариант решения преподавателю.

Бонусная часть: Предложить вариант решения для подключения из консоли при помощи команды вида ssh internalhost из локальной консоли рабочего устройства, чтобы подключение выполнялось по алиасу internalhost

Вариант №1: используем SSH Port Forwarding

# строим туннель до хоста 10.156.0.3, расположенного в приватной сети
➜ stage git:(terraform-service-account) ✗ /Users/ak/Downloads/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=ansible-gce.json
Activated service account credentials for: [[email protected]]
➜ stage git:(terraform-service-account) ✗
➜ stage git:(terraform-service-account) ✗
➜ stage git:(terraform-service-account) ✗ /Users/ak/Downloads/google-cloud-sdk/bin/gcloud compute instances list
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
reddit-db europe-west1-b g1-small 10.132.0.2 35.189.235.188 RUNNING
➜ stage git:(terraform-service-account) ✗
➜ stage git:(terraform-service-account) ✗
➜ stage git:(terraform-service-account) ✗