This gist is deprecated. Please see http://github.com/sethvargo/hashicorp-installer.
Create qcow image
qemu-img create -f qcow2 file.qcow2 100M
sudo mkfs.ext4 file.qcow2
Add drive it to the MicroVM
--add-drive=file.qcow2:rw
Create Bridge interface on the host and give internet access
sudo ip link add name br0 type bridge
sudo ip addr add 172.20.0.1/24 dev br0
sudo ip link set dev br0 up
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables --table nat --append POSTROUTING --out-interface enp3s0 -j MASQUERADE
sudo iptables --insert FORWARD --in-interface br0 -j ACCEPT
Create a tap device and link to the bridge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule MyApp.Repo.Migrations.AddPostgresTriggerAndFunctionForAllTables do | |
| use Ecto.Migration | |
| def up do | |
| # Create a function that broadcasts row changes | |
| execute " | |
| CREATE OR REPLACE FUNCTION broadcast_changes() | |
| RETURNS trigger AS $$ | |
| DECLARE | |
| current_row RECORD; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {{- range services -}} | |
| {{- if .Name | contains "sidecar" | not -}} | |
| {{- $groupedServices := (service .Name | byMeta "caddy_enable") -}} | |
| {{- $enabledServices := (index $groupedServices "true" ) -}} | |
| {{- range $enabledServices -}} | |
| {{- $vhost := index .ServiceMeta "caddy_vhost" -}} | |
| {{- scratch.MapSetX "vhosts" $vhost . -}} | |
| {{- end -}} | |
| {{- end -}} | |
| {{- end -}} |
OlderNewer