首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >云Init不在Vultr上工作

云Init不在Vultr上工作
EN

Server Fault用户
提问于 2022-10-10 16:20:57
回答 1查看 481关注 0票数 1

我是Cloud的新手,我正在尝试用它来安装尾部和Docker,以及一些其他的软件包。

我试了几次,没有运气,也没有错误日志。

我做错什么了?

这是我的剧本:

代码语言:javascript
运行
复制
#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
EN

回答 1

Server Fault用户

回答已采纳

发布于 2022-10-11 03:21:01

如果您的yaml粘贴正确,您的缩进是错误的,并且您在您的docker行中缺少了一个D1

试试这个:

代码语言:javascript
运行
复制
#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中的任何WARNINGTraceback。日志可能相当冗长,但至少可以给您一个起点。

云init模式文档:https://cloudinit.readthedocs.io/en/latest/topics/cli.html#schema

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1112736

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档