用于更新Discourses的Ansible剧本

啊,抱歉,是的,这是一个私有仓库。我几乎从不这样做!我一定是为那些东西的无用感到尴尬…… :rofl:

这是那个文件:

---
- hosts: all
  vars:
    ansible_python_interpreter: auto_silent

  tasks:
  - name: 更新服务器操作系统(apt update && apt dist-upgrade && apt autoremove && apt autoclean)
    become: yes
    apt:
      update-cache: yes
      upgrade: dist
      autoremove: yes
      autoclean: yes

  # - name: 从 GitHub 更新 Discourse 代码(cd /var/discourse && git pull)
  #   become: yes
  #   git:
  #     repo: 'https://github.com/discourse/discourse_docker.git'
  #     dest: /var/discourse
  #     update: yes
  #     version: master
  #   register: gitcommit

  # - name: 重新构建 Discourse 容器(cd /var/discourse && ./launcher rebuild app)
  #   become: yes
  #   shell: ./launcher rebuild app
  #   args:
  #     chdir: /var/discourse
  #   when: gitcommit.changed

  # - name: 清理已停止的容器(cd /var/discourse && ./launcher cleanup)
  #   become: yes
  #   shell: echo Y | ./launcher cleanup
  #   args:
  #     chdir: /var/discourse

  # - name: 使用默认 Ansible 设置重启机器
  #   reboot:
  #   become: yes

如你所见,它几乎是无用的。

如果有人对开发一些共享脚本以自动更新操作系统、Discourse、清理启动器,以及(作为奖励)写入每个 Discourse 实例的 Changelog 感兴趣,我很乐意帮忙。对我个人而言,维护自己的 Ansible playbook 并不值得。

1 个赞