Categorygithub.com/express42/packer-builder-selectel
repositorypackage
1.0.0-rc1
Repository: https://github.com/express42/packer-builder-selectel.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

packer-builder-selectel

This plugin is packer builder for Selectel Cloud. It was forked from packer-builder-openstack.

How to build

  1. Clone repo.
git clone [email protected]:express42/packer-builder-selectel.git
cd packer-builder-selectel
  1. Prepare your Go workspace and get dependencies.
export GOPATH=$HOME/go
go get
  1. Workaround for https://github.com/hashicorp/packer/pull/3176
rm -rf $GOPATH/src/github.com/hashicorp/packer/vendor
go get
  1. Run build
go build
  1. Or run build with output into packer plugins directory.
go build -o  ~/.packer.d/plugins/packer-builder-selectel

How to install

Place packer-builder-selectel executable into ~/.packer.d/plugins/ directory or run build with -o flag.

go build -o  ~/.packer.d/plugins/packer-builder-selectel

How to use

Prepare your environment

  1. Log into your VPC control panel https://<%NNNNN%>.selvpc.ru/auth/, where <%NNNNN%> is numeric ID of your VPC, e.g. 12345, 54321, etc.
  2. Select Access tab https://<%NNNNN%>.selvpc.ru/access/.
  3. Click Download RC-file for user <%username%>, where <%username%> is your username.
  4. Run command and enter your password for selectel's vpc.
source ~/Downloads/rc.sh
  1. Now you can use Selectel API and run packer or openstack commands.

Packer builder configuration

  1. See documentation for packer-builder-openstack. But you should use "type": "selectel".
  2. See examples.

How to debug

General

  1. Run packer with env var PACKER_LOG=1.
PACKER_LOG=1 packer build examples/ubuntu.json
  1. You will see debug info inside your console.

API calls

  1. Run mitmproxy.
docker run -t -i -p 8080:8080 mitmproxy/mitmproxy
  1. Copy mitmproxy CA cert from container to your local computer.
docker cp $(docker ps --filter='expose=8080/tcp' -q):/home/mitmproxy/.mitmproxy/mitmproxy-ca-cert.cer ./
  1. Install mitmproxy-ca-cert.cer as trusted CA cerificate into your OS.
  2. Run packer with env vars HTTP_PROXY and HTTPS_PROXY.
HTTP_PROXY=http://127.0.0.1:8080/ HTTPS_PROXY=$http_proxy packer build examples/ubuntu.json
  1. You will see requests to api in your container's shell.

How to contribute

  1. Look for issue you want to fix in bug tracker.
  2. Fork repo.
  3. Fix code.
  4. Make Pull Request.
  5. Mention fixed issues.