gpt4 book ai didi

docker - Vagrant 使用 puppet 安装 docker

转载 作者:行者123 更新时间:2023-12-02 05:05:09 32 4
gpt4 key购买 nike

我正在尝试在 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

list /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.

有人可以告诉我我做错了什么吗?

最佳答案

最新版本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

如果您想让 if 在您的示例中工作,您需要强制安装 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

关于docker - Vagrant 使用 puppet 安装 docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44387006/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com