Vagrant 安装 docker with puppet
Vagrant install docker with puppet
我正在尝试在 trusty64 vagrant 图像上安装 docker:
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "apps.local"
config.vm.provision "shell", inline: <<-SHELL
puppet module install garethr-docker
SHELL
config.vm.provision "puppet"
end
manifests/default.pp
include 'docker'
docker::image { 'ubuntu':
image_tag => 'trusty'
}
而vagrant up
的输出:
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Notice: Preparing to install into /etc/puppet/modules ...
==> default: Notice: Downloading from https://forge.puppetlabs.com ...
==> default: Notice: Installing -- do not interrupt ...
==> default: /etc/puppet/modules
==> default: └─┬ garethr-docker (v5.3.0)
==> default: ├── puppetlabs-apt (v3.0.0)
==> default: ├── puppetlabs-stdlib (v4.17.0)
==> default: └── stahnma-epel (v1.2.2)
==> default: Running provisioner: puppet...
==> default: Running Puppet with default.pp...
==> default: Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
==> default: Error: Syntax error at 'Variant'; expected ')' at /etc/puppet/modules/apt/manifests/init.pp:6 on node carcosa.local
==> default: Error: Syntax error at 'Variant'; expected ')' at /etc/puppet/modules/apt/manifests/init.pp:6 on node carcosa.local
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
谁能告诉我我做错了什么?
如果您的目标只是在 VM 上安装 docker,最简单的方法就是让 vagrant 安装它。 Vagrant 有 docker provisioner,如果没有安装它会尝试安装
这个简单的 Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision "docker"
end
将在 trusty64 上安装 docker - 如果您想使用 docker 图片等,供应商有很多优势...
最新版puppetlabs-apt module只支持最新版puppet
Latest version is compatible with:
- Puppet Enterprise 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 5.0.0
- Ubuntu, Debian
如果你想在你的示例中工作,你需要强制安装 puppet 3.x 支持的版本(参见 https://forge.puppet.com/puppetlabs/apt/1.6.0/changelog)
以下 Vagrantfile
将完成工作
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
#config.vm.provision "docker"
config.vm.hostname = "apps.local"
config.vm.provision "shell", inline: <<-SHELL
puppet module install puppetlabs-apt --version 2.4.0
puppet module install garethr-docker
SHELL
config.vm.provision "puppet"
end
我正在尝试在 trusty64 vagrant 图像上安装 docker:
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "apps.local"
config.vm.provision "shell", inline: <<-SHELL
puppet module install garethr-docker
SHELL
config.vm.provision "puppet"
end
manifests/default.pp
include 'docker'
docker::image { 'ubuntu':
image_tag => 'trusty'
}
而vagrant up
的输出:
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Notice: Preparing to install into /etc/puppet/modules ...
==> default: Notice: Downloading from https://forge.puppetlabs.com ...
==> default: Notice: Installing -- do not interrupt ...
==> default: /etc/puppet/modules
==> default: └─┬ garethr-docker (v5.3.0)
==> default: ├── puppetlabs-apt (v3.0.0)
==> default: ├── puppetlabs-stdlib (v4.17.0)
==> default: └── stahnma-epel (v1.2.2)
==> default: Running provisioner: puppet...
==> default: Running Puppet with default.pp...
==> default: Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
==> default: Error: Syntax error at 'Variant'; expected ')' at /etc/puppet/modules/apt/manifests/init.pp:6 on node carcosa.local
==> default: Error: Syntax error at 'Variant'; expected ')' at /etc/puppet/modules/apt/manifests/init.pp:6 on node carcosa.local
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
谁能告诉我我做错了什么?
如果您的目标只是在 VM 上安装 docker,最简单的方法就是让 vagrant 安装它。 Vagrant 有 docker provisioner,如果没有安装它会尝试安装
这个简单的 Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision "docker"
end
将在 trusty64 上安装 docker - 如果您想使用 docker 图片等,供应商有很多优势...
最新版puppetlabs-apt module只支持最新版puppet
Latest version is compatible with:
- Puppet Enterprise 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 5.0.0
- Ubuntu, Debian
如果你想在你的示例中工作,你需要强制安装 puppet 3.x 支持的版本(参见 https://forge.puppet.com/puppetlabs/apt/1.6.0/changelog)
以下 Vagrantfile
将完成工作
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
#config.vm.provision "docker"
config.vm.hostname = "apps.local"
config.vm.provision "shell", inline: <<-SHELL
puppet module install puppetlabs-apt --version 2.4.0
puppet module install garethr-docker
SHELL
config.vm.provision "puppet"
end