AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1112736
Accepted
Rodrigo
Rodrigo
Asked: 2022-10-11 08:20:57 +0800 CST2022-10-11 08:20:57 +0800 CST 2022-10-11 08:20:57 +0800 CST

Cloud Init 无法在 Vultr 上运行

  • 772

我是 Cloud-Init 的新手,我正在尝试使用它安装 tailscale 和 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
cloud-init
  • 1 1 个回答
  • 24 Views

1 个回答

  • Voted
  1. Best Answer
    falcojr
    2022-10-11T19:21:01+08:002022-10-11T19:21:01+08:00

    如果您的 yaml 粘贴正确,则您的缩进是错误的,并且您的行中缺少:a 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
    

    注意第 5-7 行和第:16 行末尾的缩进。

    一般来说,为了调试 cloud-init,有一个命令可以检查你#cloud-config的模式。在启动的实例上,您可以运行 cloud-init schema --system. 此外,您可以检查/var/log/cloud-init.log任何WARNING或Traceback。日志可能相当冗长,但这至少可以为您提供一个起点。

    cloud-init 架构文档:https ://cloudinit.readthedocs.io/en/latest/topics/cli.html#schema

    • 1

相关问题

  • 如何确保 Cloud-Init 只运行一次且只运行一次?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve