<commit_before>---
# FIXME: This uses podman, so does not work on cockpit-11 right now
- hosts: tag_ServiceComponent_Images
  gather_facts: false

  tasks:
  - name: "Upload images service installation script"
    copy:
      src: "{{ playbook_dir }}/../../images/install-service"
      dest: /run/install-service
      mode: preserve

  - name: "Set up systemd service for cockpit/images"
    command: /run/install-service

  - name: "Set up image syncing: service"
    copy:
      dest: /etc/systemd/system/cockpit-image-sync.service
      mode: 0644
      content: |
        [Unit]
        Description=Regularly sync cockpit images from other servers
        [Service]
        Type=oneshot
        ExecStart=/usr/bin/podman run -i --rm --volume=/var/cache/cockpit-tasks/images:/cache/images:rw quay.io/cockpit/tasks sh -exc 'mkdir -p ~/.cache; ln -s /cache/images ~/.cache/cockpit-images; git clone https://github.com/cockpit-project/bots; bots/image-download; bots/image-prune -c --force'
        TimeoutStartSec=1h

  - name: "Set up image syncing: timer"
    copy:
      dest: /etc/systemd/system/cockpit-image-sync.timer
      mode: 0644
      content: |
        [Unit]
        Description=Regularly sync cockpit images from other servers
        [Timer]
        OnActiveSec=10min
        OnUnitActiveSec=1h
        RandomizedDelaySec=10min
        [Install]
        WantedBy=timers.target

  - name: Enable image syncing
    systemd:
      name: cockpit-image-sync.timer
      enabled: true
      state: started<commit_msg>ansible: Drop syncing from images deployments<commit_after>---
# FIXME: This uses podman, so does not work on cockpit-11 right now
- hosts: tag_ServiceComponent_Images
  gather_facts: false

  tasks:
  - name: "Upload images service installation script"
    copy:
      src: "{{ playbook_dir }}/../../images/install-service"
      dest: /run/install-service
      mode: preserve

  - name: "Set up systemd service for cockpit/images"
    command: /run/install-service
{'fraction_non_alphanumeric': 0.10810810810810811, 'fraction_numerical': 0.009009009009009009, 'mean_word_length': 2.6279491833030852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4307313', 'n_tokens_mistral': 633, 'n_tokens_neox': 601, 'n_words': 168}