robertdebock.maintenance

Ansible Role Maintenance

Keep your system clean and well-maintained.

GitHub GitLab Downloads Version
github gitlab downloads Version

Example Playbook

Here’s a simple example from molecule/default/converge.yml, tested with each update.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

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

First, prepare your system. In Continuous Integration (CI), this uses molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: robertdebock.bootstrap

  tasks:
    - name: Create a file
      ansible.builtin.copy:
        dest: /tmp/some_file.txt
        content: "Some content"
        mode: "0644"

For more details, check the full guide and examples.

Role Variables

Default values for variables are found in defaults/main.yml:

---
# default settings for maintenance

maintenance_journalctl_vacuum: 10d

# List of files that need to be emptied.
# maintenance_files_to_empty:
#   - /tmp/some_file.txt

Requirements

State of Used Roles

These roles help get your system ready. You can also prepare it in other ways.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab

Context

This role works with many other compatible roles. For more information, check the documentation for these roles.

Here’s a visual of related roles: dependencies

Compatibility

This role has been tested on various container images:

Container Tags
Alpine all
Amazon Candidate
EL 9
Debian all
Fedora all
Ubuntu all

Ansible version required is 2.12. Tests have been performed for:

  • The previous version.
  • The current version.
  • The development version.

If you find any issues, please report them on GitHub.

License

Apache-2.0.

Author Information

robertdebock

Please consider sponsoring me.

Informazioni sul progetto

Maintain your system by cleaning up.

Installa
ansible-galaxy install robertdebock.maintenance
Licenza
apache-2.0
Download
8.7k
Proprietario
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.