buluma.maintenance

Ansible 角色 maintenance

通过清理来维护您的系统。

GitHub 版本 问题 拉取请求 下载
github 版本 问题 拉取请求 Ansible 角色

示例剧本

这个示例来自 molecule/default/converge.yml,每次推送、拉取请求和发布时都会进行测试。

---
- name: 合并
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - role: buluma.maintenance
      maintenance_files_to_empty:
        - /tmp/some_file.txt

机器需要准备。在 CI 中,这是用 molecule/default/prepare.yml 完成的:

---
- name: 准备
  hosts: all
  become: yes
  gather_facts: no

  roles:
    - role: buluma.bootstrap

  tasks:
    - name: 创建一个文件
      ansible.builtin.copy:
        dest: /tmp/some_file.txt
        content: "一些内容"
        mode: "0644"

也可以查看完整说明和示例以了解如何使用这些角色。

角色变量

变量的默认值在 defaults/main.yml 中设置:

---
# maintenance 的默认文件

maintenance_journalctl_vacuum: 10d

# 需要清空的文件列表。
# maintenance_files_to_empty:
#   - /tmp/some_file.txt

要求

已用角色的状态

以下角色用于准备系统。您可以以其他方式准备您的系统。

要求 GitHub 版本
buluma.bootstrap Ansible Molecule 版本

上下文

此角色是许多兼容角色的一部分。有关更多信息,请查看这些角色的文档

以下是相关角色的概述:

依赖关系

兼容性

此角色已在以下容器镜像上进行测试:

容器 标签
Alpine 所有
Amazon 所有
EL 8
Debian 所有
Fedora 所有
opensuse 所有
Ubuntu 所有
Kali 所有

所需的最低 Ansible 版本为 2.12,测试已在:

  • 较早的版本。
  • 当前版本。
  • 开发版本。

如果您发现问题,请在 GitHub 上提交。

更新日志

角色历史

许可证

Apache-2.0

作者信息

Shadow Walker

关于项目

Maintain your system by cleaning up.

安装
ansible-galaxy install buluma.maintenance
许可证
apache-2.0
下载
18.3k
拥有者
DevOps Engineer