diff --git a/provision-contest/ansible/admin.yml b/provision-contest/ansible/admin.yml index e847f41d..f36a6f78 100644 --- a/provision-contest/ansible/admin.yml +++ b/provision-contest/ansible/admin.yml @@ -70,20 +70,6 @@ set_fact: dj_git_repo_scripts: "{{ DJ_GIT_REPO_SCRIPTS_RESTRICTED if WF_RESTRICTED_NETWORK else DJ_GIT_REPO_SCRIPTS }}" - - name: Download offline repos - when: WF_RESTRICTED_NETWORK - block: - - name: Create working copy of the domjudge-scripts repo - become: true - become_user: domjudge - # We use a different directory here to have one single 'upstream' and not have issues with it - git: repo={{ dj_git_repo_scripts }} dest=/home/domjudge/domjudge-scripts-checkout version=main accept_hostkey=yes update=no - - - name: Create working copy of the contest repo - become: true - become_user: domjudge - git: repo=git@cds:{{ CONTEST_REPO }} dest=/home/domjudge/{{ CONTEST_REPO }} version=master accept_hostkey=yes update=no - - name: Copy custom CSS file for admin machines copy: src: admin-machine.css @@ -151,3 +137,33 @@ etype: user permissions: rwx state: present + + - name: Download offline repos + when: WF_RESTRICTED_NETWORK + become: true + become_user: domjudge + block: + - name: Add ccsadmin remote + git_config: + name: "remote.{{ item.remote }}.url" + value: "{{ item.url }}" + scope: local + repo: /home/domjudge/domjudge-checkout + loop: + - remote: origin + url: ansible@10.3.3.224:domjudge + - remote: github + url: git@github.com:DOMjudge/domjudge.git + - remote: sysops + url: domjudge@packages:domjudge.git + - remote: initial + url: ansible@domjudge-ccsadmin1:domjudge.git + + - name: Create working copy of the domjudge-scripts repo + # We use a different directory here to have one single 'upstream' and not have issues with it + git: repo={{ dj_git_repo_scripts }} dest=/home/domjudge/domjudge-scripts-checkout version=main accept_hostkey=yes update=no + + - name: Create working copy of the contest repo + ignore_errors: true + git: repo=git@packages:{{ CONTEST_REPO }} dest=/home/domjudge/{{ CONTEST_REPO }} version=master accept_hostkey=yes update=no +