# 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
- Clone repo.
git clone [email protected]:express42/packer-builder-selectel.git
cd packer-builder-selectel
- Prepare your Go workspace and get dependencies.
export GOPATH=$HOME/go
go get
- Workaround for https://github.com/hashicorp/packer/pull/3176
rm -rf $GOPATH/src/github.com/hashicorp/packer/vendor
go get
- Run build
go build
- 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
- Log into your VPC control panel
https://<%NNNNN%>.selvpc.ru/auth/
, where <%NNNNN%> is numeric ID of your VPC, e.g. 12345, 54321, etc. - Select
Access
tabhttps://<%NNNNN%>.selvpc.ru/access/
. - Click
Download RC-file for user <%username%>
, where <%username%> is your username. - Run command and enter your password for selectel's vpc.
source ~/Downloads/rc.sh
- Now you can use Selectel API and run
packer
oropenstack
commands.
Packer builder configuration
- See documentation for packer-builder-openstack. But you should use
"type": "selectel"
. - See examples.
How to debug
General
- Run
packer
with env varPACKER_LOG=1
.
PACKER_LOG=1 packer build examples/ubuntu.json
- You will see debug info inside your console.
API calls
- Run mitmproxy.
docker run -t -i -p 8080:8080 mitmproxy/mitmproxy
- 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 ./
- Install
mitmproxy-ca-cert.cer
as trusted CA cerificate into your OS. - Run
packer
with env varsHTTP_PROXY
andHTTPS_PROXY
.
HTTP_PROXY=http://127.0.0.1:8080/ HTTPS_PROXY=$http_proxy packer build examples/ubuntu.json
- You will see requests to api in your container's shell.
How to contribute
- Look for issue you want to fix in bug tracker.
- Fork repo.
- Fix code.
- Make Pull Request.
- Mention fixed issues.