# 一些帮助我启动新服务器的 Ansible 脚本

**URL:** https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608
**Category:** Self-hosting
**Created:** [2020年四月11日 09:27 UTC](https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608 "2020-04-11T09:27:20Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![dnk8n](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dnk8n](https://meta.discourse.org/u/dnk8n)
#### Post date: [2020年四月11日 09:27 UTC](https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608/1 "2020-04-11T09:27:20Z")

</div>

这能让我更快地进入安装步骤。它处理了 Git、Docker 安装等事宜。目前仅在 [https://hetzner.cloud](https://hetzner.cloud) 上测试过，但应该也适用于其他平台。如果使用 AWS 或类似平台（无需以 root 身份登录），只需跳过第一个代码块即可。

> **[Dean Kayton / discourse-up · GitLab](https://gitlab.com/dnk8n/discourse-up)**
>
> Automation for my Discourse installation

不确定我是否还会添加更多内容。但如果能通过配置模板完成 Discourse 的完整基础安装，这将会很有用。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020年四月11日 10:47 UTC](https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608/2 "2020-04-11T10:47:09Z")

</div>

我的安装服务使用 Ansible 实现完全自动化的安装。一个 playbook 负责创建 DigitalOcean 的 Droplet 实例，执行一些基础配置调整，并在 Mailgun 中创建域名。随后，它会发送一封包含 DNS 设置说明的邮件，等待 A 记录创建完成，再等待 Mailgun 验证该域名。接着，它继续安装 Discourse 及其插件，为 Mailgun 的退信处理设置 Webhook，创建邮件接收器，配置 Discourse 使用该接收器，并在完成后向用户发送通知。

目前缺失的环节是 DNS 配置，但由于我的客户使用了各种各样的 DNS 服务，试图覆盖所有情况无异于徒劳。（我本可以花更少的时间手动完成所有安装，但那样还有什么乐趣呢？）

---

<div class="post-metadata">

### Author: ![dnk8n](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dnk8n](https://meta.discourse.org/u/dnk8n)
#### Post date: [2020年四月11日 10:55 UTC](https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608/3 "2020-04-11T10:55:23Z")

</div>

你们的模板是开源的吗？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020年四月11日 11:03 UTC](https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608/4 "2020-04-11T11:03:14Z")

</div>

现在还不行。它还不够美观，不适合分享。而且，任何想要代码的人要么是竞争对手，要么更可能是需要大量免费支持才能让它运行起来的人。

---

<div class="post-metadata">

### Author: ![dnk8n](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dnk8n](https://meta.discourse.org/u/dnk8n)
#### Post date: [2020年四月11日 12:49 UTC](https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608/5 "2020-04-11T12:49:38Z")

</div>

不过，这未必是事实。他们可能是那些既不需要支持，也不愿参与竞争的人。不过，很高兴你找到了适合自己的方案。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020年四月11日 14:30 UTC](https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608/6 "2020-04-11T14:30:34Z")

</div>

我原则上同意你的观点，但要确保其中没有混杂私人信息，还需要花几个小时。目前我还有其他更优先的事项尚未完成，例如更新多个导入脚本，以及为 Discourse 设置配置 MaxMind API 密钥等。

---

<div class="post-metadata">

### Author: ![Wurzelseppi](https://avatars.discourse-cdn.com/v4/letter/w/eada6e/32.png) [@Wurzelseppi](https://meta.discourse.org/u/Wurzelseppi)
#### Post date: [2022年十月2日 09:43 UTC](https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608/7 "2022-10-02T09:43:17Z")

</div>

您好 @pfaffman，  
我正准备安装一个新的 discourse：🙂  
此时（对我来说）是安装 discourse 的一个很棒的 playbook / role 的时机 😛

祝好，

Julian

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2022年十月2日 11:16 UTC](https://meta.discourse.org/t/some-ansible-scripts-that-help-me-start-a-new-server/147608/8 "2022-10-02T11:16:21Z")

</div>

您可以前往 [dashboard.literatecomputing.com](http://dashboard.literatecomputing.com) 并使用我的。
