---
- hosts: openzfs-jenkins-public
  tasks:
    - name: Stop the Jenkins instance prior to synchronizing
      become: true
      become_user: "root"
      service:
        name: "jenkins"
        state: "stopped"
    - name: Synchronize the public and private Jenkins instances
      become: true
      become_user: "root"
      synchronize:
        src: /var/lib/jenkins/
        dest: /var/lib/jenkins
        archive: true
        delete: true
        compress: true
    - name: Start the Jenkins instance after synchronizing completes
      become: true
      become_user: "root"
      service:
        name: "jenkins"
        state: "started"

---
- hosts: openzfs-jenkins-public
  tasks:
    - name: Stop the Jenkins instance prior to synchronizing
      become: true
      become_user: "root"
      service:
        name: "jenkins"
        state: "stopped"
    - name: Synchronize the public and private Jenkins instances
      become: true
      become_user: "root"
      synchronize:
        src: /var/lib/jenkins/
        dest: /var/lib/jenkins
        archive: true
        delete: true
        compress: true
    - name: Disable the necessary Jenkins jobs
      become: true
      become_user: "root"
      replace:
        dest: "/var/lib/jenkins/jobs/{{ item }}/config.xml"
        regexp: "<disabled>false</disabled>"
        replace: "<disabled>true</disabled>"
      with_items:
        - "openzfs-regression-tests"
        - "synchronize-jenkins-mirror"
    - name: Start the Jenkins instance after synchronizing completes
      become: true
      become_user: "root"
      service:
        name: "jenkins"
        state: "started"

Disable specific Jenkins jobs on the public mirror
Disable specific Jenkins jobs on the public mirror

This patch updates the Ansible playbook that synchronizes the public
Jenkins instance, to also disable specific Jenkins jobs on the public
instance that would otherwise cause issues. For example, if the
"openzfs-regression-tests" job is not disabled on the public instance,
this job would attempt to poll the GitHub project page and compete with
the polling done by the internal Jenkins instance.

Closes #12
