- name: Menus and commands of the contest (ACPC 2026 on Kattis) hosts: all become: yes vars: contest_url: https://atlantic-canada26.kattis.com contest_id: atlantic-canada26 # Contest menu (category "Contest" of the Xubuntu menu of the ICPC image) contest_entries: - { file: acpc-contest, name: "Contest (Kattis)", url: "{{ contest_url }}/contests/{{ contest_id }}" } - { file: acpc-problems, name: "Problems", url: "{{ contest_url }}/contests/{{ contest_id }}/problems" } - { file: acpc-standings, name: "Standings", url: "{{ contest_url }}/contests/{{ contest_id }}/standings" } - { file: acpc-help, name: "Contest Help (offline)", url: "file:///usr/share/doc/acpc/help/index.html" } tasks: # Entries of the ICPC image made for the World Finals: their contest # server (https://contest), the PC² guide and the World Finals judging notes - name: Remove the menu entries that do not apply to this contest file: path: "/usr/share/applications/{{ item }}" state: absent loop: - ccs.desktop - scoreboard.desktop - problems.desktop - ccsdocs.desktop - judgingnotes.desktop - name: Contest menu with the Kattis pages copy: dest: "/usr/share/applications/{{ item.file }}.desktop" mode: '0644' content: | [Desktop Entry] Type=Application Name={{ item.name }} Exec=firefox {{ item.url }} Icon=firefox Categories=Contest; loop: "{{ contest_entries }}" - name: Same name for the documentation as the bookmark lineinfile: path: /usr/share/applications/devdocs.desktop regexp: '^Name=' line: Name=Language Documentation # submit and pc2submit send to a PC² or DOMjudge server, which this # contest does not use - name: Remove the submit link of the ICPC image (it points to pc2submit) file: path: /usr/local/bin/submit state: absent - name: Replace the submit commands with a pointer to Kattis copy: dest: "/usr/local/bin/{{ item }}" mode: '0755' content: | #!/bin/bash echo "This contest runs on Kattis. Submit your solutions on the contest site:" echo " {{ contest_url }}/contests/{{ contest_id }}/problems" echo "(Submit button on the page of each problem)" exit 1 loop: - submit - pc2submit # Kotlin is not a language of this contest (the compiler stays installed) - name: Remove the Kotlin compile and run commands file: path: "/usr/local/bin/{{ item }}" state: absent loop: - compilekotlin - runkotlin # JetBrains IDEs (CLion, IntelliJ IDEA, PyCharm): first-launch questions # answered in advance (agreement accepted by the organizers, no data # sharing), /home/team trusted, PyPy as the Python of PyCharm. /etc/skel # is used by reset_team_home.sh. - name: Settings of the JetBrains IDEs for the team account script: "files/desktop/jetbrains_first_run.sh {{ item }}" loop: - /home/team - /etc/skel # Eclipse runs programs with the Java it runs on. The ICPC image starts it # with its own Java 21, and Kattis uses Java 25.0.4.1. - name: Eclipse runs on the Java of the system (25.0.4.1, as on Kattis) replace: path: /opt/eclipse/eclipse.ini regexp: '^plugins/org\.eclipse\.justj\.openjdk\.[^\n]*/bin/java$' replace: /usr/lib/jvm/java-25-openjdk-amd64/bin/java - name: Install the contest compiler drivers and IDE build command copy: src: "files/ide/{{ item }}" dest: "/usr/local/bin/{{ item }}" mode: '0755' loop: - acpc-cc - acpc-solution - acpc-eclipse - name: C and C++ compiler driver names file: src: /usr/local/bin/acpc-cc dest: "/usr/local/bin/{{ item }}" state: link loop: - acpc-gcc - acpc-g++ - name: Eclipse CDT compiler command directory file: path: /usr/local/lib/acpc-toolchain state: directory mode: '0755' - name: Compiler names used by Eclipse CDT GNU projects file: src: "/usr/local/bin/{{ item.target }}" dest: "/usr/local/lib/acpc-toolchain/{{ item.name }}" state: link loop: - { name: gcc, target: acpc-gcc } - { name: cc, target: acpc-gcc } - { name: g++, target: acpc-g++ } - { name: c++, target: acpc-g++ } - name: Eclipse menu opens the configured contest workspace lineinfile: path: /usr/share/applications/Eclipse.desktop regexp: '^Exec=' line: 'Exec=/usr/local/bin/acpc-eclipse' - name: VS Code menu opens the contest folder so its build tasks are available replace: path: /usr/share/applications/com.microsoft.VSCode.desktop regexp: '^Exec=/usr/share/code/code %F$' replace: 'Exec=/usr/share/code/code /home/team/contest %F' - name: Configure the contest compilers in every IDE script: files/desktop/configure_ides.py register: ide_settings changed_when: "'changed=0' not in ide_settings.stdout"