我正在尝试通过Puppet安装docker-ce,有几个问题:
1:apt::key后面是否自动执行'apt-get update'?
2:如何使用apt:ppa模块添加docker-ce 仓库?下面是具体步骤:
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
但是我该如何使用apt::ppa来包含发布版和发行版呢?
这是整个Puppet块:
class docker {
$prerequisites = ['apt-transport-https', 'ca-certificates', 'curl']
package { $prerequisites: ensure => installed}
apt::key { 'docker-ce':
ensure => present,
id => '9DC858229FC7DD38854AE2D88D81803C0EBFCD88',
options => 'https://download.docker.com/linux/ubuntu/gpg',
}
apt::ppa {''}
package {'docker-ce': ensure => installed}
}
编辑:
最终我使用了apt模块和apt::source,硬编码发布版本,因为我知道所有的系统都将运行它。
class docker {
include apt
$prerequisites = ['apt-transport-https', 'ca-certificates']
package { $prerequisites: ensure => installed} ->
apt::key { 'docker-ce':
ensure => present,
id => '9DC858229FC7DD38854AE2D88D81803C0EBFCD88',
options => 'https://download.docker.com/linux/ubuntu/gpg',
} ->
apt::source {'docker-ce':
location => 'https://download.docker.com/linux/ubuntu',
release => 'xenial'
} ->
exec { 'apt-get-update':
command => '/usr/bin/apt-get update'
} ->
package {'docker-ce': ensure => installed}
}