Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Convert ansible-pull example to run with systemd .timer + .service #266

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Dec 22, 2019

  1. Rename ansible_pull.yml to …_cron.yml

    It might still be useful as a reference for old systems, so let's keep
    it.
    keszybz committed Dec 22, 2019
    Configuration menu
    Copy the full SHA
    9108c93 View commit details
    Browse the repository at this point in the history
  2. Add modernized ansible-pull example

    A bit simpler, and self-contained solution with no extra files.
    
    This is based on systemd timers and services, so it is has a smaller
    footprint on systems which already have systemd installed (cron and
    logrotate dependencies are gone). I assume that ansible is mostly used
    with modern systems which have systemd available.
    
    Systemd will restart the service every OnUnitInactiveSec=, while
    making sure to not schedule overlapping runs. In practice, it is
    convenient to change the timer to something as low as one minute when
    quick updates are needed. With --only-if-changed the load on the
    system is not even noticable because all that happens is a noop git
    pull if no changes were made to the repo.
    
    The logs end up in the journal, so no logging configuration is necessary.
    keszybz committed Dec 22, 2019
    Configuration menu
    Copy the full SHA
    4c2994d View commit details
    Browse the repository at this point in the history