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 / 问题 / 787007
Accepted
Thiago Rider Augusto
Thiago Rider Augusto
Asked: 2016-06-30 12:26:01 +0800 CST2016-06-30 12:26:01 +0800 CST 2016-06-30 12:26:01 +0800 CST

有没有办法用 Packer 提供裸机?

  • 772

Packer 能否用于安装和配置裸机服务器?Packer 为 webserver 提供存储库包和 preseed/kickstart,并且可以运行一些其他配置软件(ansible、puppet、chef 等)。可以用来安装裸机服务器吗?如果是,packer .json 应该是什么样子?

packer
  • 1 1 个回答
  • 10050 Views

1 个回答

  • Voted
  1. Best Answer
    Frobbit
    2017-08-09T15:21:43+08:002017-08-09T15:21:43+08:00

    我有一个类似的问题。我在使用 Packer 和 PXE 启动时发现了这个问题线程。

    https://github.com/hashicorp/packer/issues/955

    Vasiliy Tolstov 在帖子中评论道:

    [这] 非常简单:在 VM 中安装所有需要的东西(对于 Debian live-boot,对于 Fedora/centos Dracut 可以从网络启动)。在 [build] 之后 [with] packer 运行以下脚本(例如 Debian):

    #!/bin/sh -ex
    
    apt-get -y install squashfs-tools
    
    mkdir -p /mnt/squashfs /squashfs
    mount -o bind / /mnt/squashfs
    
    mksquashfs /mnt/squashfs /squashfs/filesystem.squashfs -comp gzip -no-exports -xattrs -noappend -no-recovery -e 
    /mnt/squashfs/squashfs/filesystem.squashfs
    find /boot -name 'vmlinuz-*' -type f -exec cp {} /squashfs/vmlinuz \;
    find /boot -name 'init*' -type f -exec cp {} /squashfs/initrd.img \;
    

    并在打包器从 vm 下载工件:

    {
      "type": "file",
      "direction": "download",
      "sources": [
        "/squashfs/vmlinuz"
      ],
      "destination": "output/{{user `name`}}-squashfs/{{user `name`}}.vmlinuz"
    },
    {
      "type": "file",
      "direction": "download",
      "sources": [
        "/squashfs/initrd.img"
      ],
      "destination": "output/{{user `name`}}-squashfs/{{user `name`}}.initrd"
    },
    {
      "type": "file",
      "direction": "download",
      "sources": [
        "/squashfs/filesystem.squashfs"
      ],
      "destination": "output/{{user `name`}}-squashfs/{{user `name`}}.squashfs"
    }
    
    • 10

相关问题

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