我是Cloud的新手,我正在尝试用它来安装尾部和Docker,以及一些其他的软件包。
我试了几次,没有运气,也没有错误日志。
我做错什么了?
这是我的剧本:
#cloud-config
users:
- name: ubuntu
shell: /usr/bin/bash
ssh_import_id: gh:skhaz
sudo: ALL=(ALL:ALL) NOPASSWD:ALL
chpasswd:
expire: false
apt_upgrade: true
apt:
sources:
docker
source: deb [arch=amd64 trusted=yes] https://download.docker.com/linux/ubuntu focal stable
tailscale:
source: deb [arch=amd64 trusted=yes] https://pkgs.tailscale.com/stable/ubuntu focal main
packages:
- docker-ce
- tailscale
- aria2
- build-essential
- vim
- tmux
runcmd:
- tailscale up -authkey='REDACTED'
- ufw --force reset
- ufw allow in on tailscale0 to any
- ufw --force
发布于 2022-10-11 03:21:01
如果您的yaml粘贴正确,您的缩进是错误的,并且您在您的docker
行中缺少了一个D1
:
试试这个:
#cloud-config
users:
- name: ubuntu
shell: /usr/bin/bash
ssh_import_id: gh:skhaz
sudo: ALL=(ALL:ALL) NOPASSWD:ALL
chpasswd:
expire: false
apt_upgrade: true
apt:
sources:
docker:
source: deb [arch=amd64 trusted=yes] https://download.docker.com/linux/ubuntu focal stable
tailscale:
source: deb [arch=amd64 trusted=yes] https://pkgs.tailscale.com/stable/ubuntu focal main
packages:
- docker-ce
- tailscale
- aria2
- build-essential
- vim
- tmux
runcmd:
- tailscale up -authkey='REDACTED'
- ufw --force reset
- ufw allow in on tailscale0 to any
- ufw --force
请注意第5-7行的缩进,第16行末尾的:
。
通常,为了调试云init,有一个命令可以根据模式检查#cloud-config
。在已启动的实例上,可以运行cloud-init schema --system
。此外,您还可以检查/var/log/cloud-init.log
中的任何WARNING
或Traceback
。日志可能相当冗长,但至少可以给您一个起点。
云init模式文档:https://cloudinit.readthedocs.io/en/latest/topics/cli.html#schema
https://serverfault.com/questions/1112736
复制相似问题