monolithprojects.system_update

系统更新

这个角色将更新RHEL/CentOS和Debian/Ubuntu系统上的所有软件包。
可选择将软件包更新到特定的发行版本(默认是latest)。
另一个功能是智能重启,在您指定的smart_reboot_pkg:列表中的软件包更新后,系统将重启。

要求

系统必须能够访问软件包仓库(互联网,Red Hat Satellite等)。

角色变量

以下是defaults/main.yml的复制内容:

# 自动删除所有模块中未使用的依赖包。
autoremove_pkgs: no

# 如果更新特定软件包,则重启服务器
# smart_reboot_pkg:
#     - kernel
#     - dbus

# 指定安装所有软件包的Linux发行版版本。
# 默认情况下,软件包将更新到最新的发行版。

# Debian或Ubuntu的发行版本(例如:xenial)
# deb_release_ver:

# RHEL/CentOS的发行版本(例如:6.10)
# el6_release_ver:

# RHEL/CentOS的发行版本(例如:7.6.1810)
# el7_release_ver:

# RHEL/CentOS的发行版本(例如:8.1.1911)
# el8_release_ver:

示例剧本

简单示例。所有软件包将更新到最新版本。

---
- name: 示例
  hosts: all
  become: true
  roles:
    - role: ansible-system_update

在这个例子中,el7系统(RHEL7或CentOS7)的软件包将更新到与版本7.7.1908相同的版本。
使用autoremove_pkgs可以自动删除不再需要的依赖项。
如果更新了kerneldbus软件包,系统将重启。

---
- name: 示例
  hosts: all
  become: true
  vars:
    el7_release_ver: "7.7.1908"
    autoremove_pkgs: true
    smart_reboot_pkg:
      - kernel
      - dbus
  roles:
    - role: ansible-system_update

许可证

MIT

作者信息

由Michal Muransky于2020年创作

关于项目

Updates system packages for RHEL/CentOS/Debian/Ubuntu. Can reboot the system if critical packages are updated.

安装
ansible-galaxy install monolithprojects.system_update
许可证
mit
下载
56.1k
拥有者
Full-time Cloud Engineer, part-time adventurer