diff --git a/example_boxes/README.md b/example_boxes/README.md new file mode 100644 index 0000000..11cb5a3 --- /dev/null +++ b/example_boxes/README.md @@ -0,0 +1,18 @@ +# Vagrant LXD Example Boxe + +## Vagrant box format + +Vagrant providers each require a custom provider-specific box format. +Here are some examples of boxes for the `lxd` provider. + +## The `lxd` box format + +The `lxd` provider right now just uses the default lxd images provided +by the lxd images: remote. Upon start these will be provisioned with an +vagrant ssh user and the unsafe common pubkey of vagrant and +sshd will be enabled. All the necessary commands are defined in the +metadata.json file. + +## Bootstraped provisioners + +The boxes here are prepared to run with the ansible provisioner. diff --git a/example_boxes/centos.json b/example_boxes/centos.json new file mode 100644 index 0000000..3ee6def --- /dev/null +++ b/example_boxes/centos.json @@ -0,0 +1,17 @@ +{ + "name": "centos/7", + "description": "The latest centos/7 LXD image.", + "versions": [ + { + "version": "0.0.1", + "providers": [ + { + "name": "lxd", + "url": "file:///home/hopp/projects/vagrant/test/centos_001_lxd.box", + "checksum_type": "sha1", + "checksum": "52c6717974bc76ecb9591e55d30baf90be9c68e4" + } + ] + } + ] +} diff --git a/example_boxes/centos_001_lxd.box b/example_boxes/centos_001_lxd.box new file mode 100644 index 0000000..014a436 Binary files /dev/null and b/example_boxes/centos_001_lxd.box differ diff --git a/sid_box/README.md b/example_boxes/centos_box/README.md similarity index 79% rename from sid_box/README.md rename to example_boxes/centos_box/README.md index 11de021..8cb79cc 100644 --- a/sid_box/README.md +++ b/example_boxes/centos_box/README.md @@ -10,7 +10,5 @@ $ tar cvzf lxd.box ./metadata.json ./vagrant.pub The `lxd` provider right now just uses the default lxd images provided by the lxd images: remote. Upon start these will be provisioned with an -vagrant ssh user and and the unsafe common pubkey of vagrant and +vagrant ssh user and the unsafe common pubkey of vagrant and sshd will be enabled. - -Well, at least thats the idea for now. diff --git a/example_boxes/centos_box/metadata.json b/example_boxes/centos_box/metadata.json new file mode 100644 index 0000000..967d0a9 --- /dev/null +++ b/example_boxes/centos_box/metadata.json @@ -0,0 +1,33 @@ +{ + "provider": "lxd", + "bootstrap": { + "hostname": { + "exec": [ + ["sed", "-i", "s/<%= container %>/<%= hostname %>/", "/etc/hostname"], + ["sed", "-i", "s/<%= container %>/<%= hostname %>/", "/etc/hosts"] + ] + }, + "packages": { + "exec": [ + ["yum", "install", "-y", "sudo"], + ["yum", "install", "-y", "openssh-server"] + ] + }, + "sudo": { + "exec": [ + [ + "sed", + "-i", + "/vagrant/b;$a\\\nvagrant ALL=(ALL) NOPASSWD: ALL\\\nDefaults:vagrant !requiretty", + "/etc/sudoers" + ] + ] + }, + "sshd_service": { + "exec": [ + ["systemctl", "enable", "sshd"], + ["systemctl", "start", "sshd"] + ] + } + } +} diff --git a/gentoo_box/vagrant.pub b/example_boxes/centos_box/vagrant.pub similarity index 100% rename from gentoo_box/vagrant.pub rename to example_boxes/centos_box/vagrant.pub diff --git a/gentoo.json b/example_boxes/gentoo.json similarity index 100% rename from gentoo.json rename to example_boxes/gentoo.json diff --git a/example_boxes/gentoo_001_lxd.box b/example_boxes/gentoo_001_lxd.box new file mode 100644 index 0000000..0a09b26 Binary files /dev/null and b/example_boxes/gentoo_001_lxd.box differ diff --git a/gentoo_box/README.md b/example_boxes/gentoo_box/README.md similarity index 79% rename from gentoo_box/README.md rename to example_boxes/gentoo_box/README.md index 11de021..8cb79cc 100644 --- a/gentoo_box/README.md +++ b/example_boxes/gentoo_box/README.md @@ -10,7 +10,5 @@ $ tar cvzf lxd.box ./metadata.json ./vagrant.pub The `lxd` provider right now just uses the default lxd images provided by the lxd images: remote. Upon start these will be provisioned with an -vagrant ssh user and and the unsafe common pubkey of vagrant and +vagrant ssh user and the unsafe common pubkey of vagrant and sshd will be enabled. - -Well, at least thats the idea for now. diff --git a/gentoo_box/metadata.json b/example_boxes/gentoo_box/metadata.json similarity index 88% rename from gentoo_box/metadata.json rename to example_boxes/gentoo_box/metadata.json index aaf6c8c..a1abf21 100644 --- a/gentoo_box/metadata.json +++ b/example_boxes/gentoo_box/metadata.json @@ -19,7 +19,7 @@ [ "sed", "-i", - "/vagrant/b;$a\\\nvagrant ALL=(ALL) NOPASSWD: ALL", + "/vagrant/b;$a\\\nvagrant ALL=(ALL) NOPASSWD: ALL\\\nDefaults:vagrant !requiretty", "/etc/sudoers" ] ] diff --git a/sid_box/vagrant.pub b/example_boxes/gentoo_box/vagrant.pub similarity index 100% rename from sid_box/vagrant.pub rename to example_boxes/gentoo_box/vagrant.pub diff --git a/sid.json b/example_boxes/sid.json similarity index 72% rename from sid.json rename to example_boxes/sid.json index 27d502e..9b6bb74 100644 --- a/sid.json +++ b/example_boxes/sid.json @@ -1,5 +1,5 @@ { - "name": "lxd/debian/sid", + "name": "debian/sid", "description": "The latest debian/sid LXD image.", "versions": [ { @@ -7,7 +7,7 @@ "providers": [ { "name": "lxd", - "url": "file:///home/hopp/projects/vagrant/vagrant-lxd/sid_001_lxd.box", + "url": "file:///home/hopp/projects/vagrant/test/sid_001_lxd.box", "checksum_type": "sha1", "checksum": "21d7376327acdb7f36aa25ed89039248c6562415" } diff --git a/example_boxes/sid_001_lxd.box b/example_boxes/sid_001_lxd.box new file mode 100644 index 0000000..99fec2d Binary files /dev/null and b/example_boxes/sid_001_lxd.box differ diff --git a/example_boxes/sid_box/README.md b/example_boxes/sid_box/README.md new file mode 100644 index 0000000..8cb79cc --- /dev/null +++ b/example_boxes/sid_box/README.md @@ -0,0 +1,14 @@ +# Vagrant LXD Example Box + +Vagrant providers each require a custom provider-specific box format. +This folder shows the example contents of a box for the `lxd` provider. +To turn this into a box: + +``` +$ tar cvzf lxd.box ./metadata.json ./vagrant.pub +``` + +The `lxd` provider right now just uses the default lxd images provided +by the lxd images: remote. Upon start these will be provisioned with an +vagrant ssh user and the unsafe common pubkey of vagrant and +sshd will be enabled. diff --git a/sid_box/metadata.json b/example_boxes/sid_box/metadata.json similarity index 88% rename from sid_box/metadata.json rename to example_boxes/sid_box/metadata.json index a01cbc6..519a71c 100644 --- a/sid_box/metadata.json +++ b/example_boxes/sid_box/metadata.json @@ -19,7 +19,7 @@ [ "sed", "-i", - "/vagrant/b;$a\\\nvagrant ALL=(ALL) NOPASSWD: ALL", + "/vagrant/b;$a\\\nvagrant ALL=(ALL) NOPASSWD: ALL\\\nDefaults:vagrant !requiretty", "/etc/sudoers" ] ] diff --git a/example_boxes/sid_box/vagrant.pub b/example_boxes/sid_box/vagrant.pub new file mode 100644 index 0000000..18a9c00 --- /dev/null +++ b/example_boxes/sid_box/vagrant.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key diff --git a/gentoo_001_lxd.box b/gentoo_001_lxd.box deleted file mode 100644 index 2e3f702..0000000 Binary files a/gentoo_001_lxd.box and /dev/null differ diff --git a/sid_001_lxd.box b/sid_001_lxd.box deleted file mode 100644 index d1617f4..0000000 Binary files a/sid_001_lxd.box and /dev/null differ