guilieb.update

ansible-role-update: System aktualisieren und automatische Updates konfigurieren

Aktualisieren Sie das System (alle) und installieren Sie einen automatischen Paket-Updateservice (yum-cron oder dnf-automatic), je nach Zielbetriebssystem.

Rollenvariablen

Wenn das Zielsystem CentOS 7 oder RHEL 7 ist, wird yum-cron installiert, Konfiguration siehe unten:

yum_automatic:
  base:
    debuglevel: -2
    mdpolicy: 'group:main'
  commands:
    apply_updates: false
    download_updates: true
    random_sleep: 0
    update_cmd: default
    update_messages: true
  email:
    email_from: root@localhost
    email_host: localhost
    email_to: root
  emitters:
    emit_via: stdio
    output_width: 80
    system_name: None
  groups:
    group_list: None
    package_types:
      - mandatory
      - default

Wenn das Zielsystem CentOS oder RHEL > 7 oder Fedora ist, wird stattdessen dnf-automatic verwendet, Konfiguration siehe unten:

dnf_automatic:
  commands:
    apply_updates: false
    download_updates: false
    random_sleep: 0
    upgrade_type: default
  command:
    command_format: cat
    stdin_format: '"{body}"'
  command_email:
    command_format: '"mail -s {subject} -r {email_from} {email_to}"'
    stdin_format: '"{body}"'
    email_from: root
    email_to: root
  emitters:
    emit_via: stdio
    system_name: None
  email:
    email_from: root
    email_host: localhost
    email_to: root

Hinweis: Um nur die Parameter zu überschreiben, die Sie möchten, beachten Sie die Einstellungen für hash_behaviour.

Beispiel-Playbook

---
- hosts: localhost
  become: true
  connection: local

  vars:
    dnf_automatic:
      commands:
        download_updates: true
      command_email:
        email_to: [email protected]

  roles:
    - guilieb.update

Autoreninformation

Über das Projekt

A simple Ansible role to update the system and configure yum-cron or dnf-automatic.

Installieren
ansible-galaxy install guilieb.update
GitHub Repository
Lizenz
gpl-3.0
Downloads
108
Besitzer
Software Engineer & Data Scientist @ MAIF