daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Dec 23rd, 2017 17 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. - hosts: judgehosts
  3.   user: root
  4.   vars:
  5.     domjudge_api: http://103.252.50.78/domjudge/api/
  6.     judgehost_user: judgehost
  7.     judgehost_pass: MzfJYWF5agSlUfmiGEy5mgkfqU
  8.  
  9.   tasks:
  10.     - name: yum update
  11.       action: yum name=* state=latest
  12.     - name: yum install epel
  13.       yum: name=epel-release.noarch state=latest
  14.     - name: download remi repo rpm
  15.       get_url: url=http://rpms.famillecollet.com/enterprise/remi-release-6.rpm dest=/root/  
  16.     - name: install remi repo rpm
  17.       yum: name=/root/remi-release-6.rpm state=present
  18.  
  19.     - name: Install all
  20.       yum: state=latest enablerepo=remi,remi-php56 name={{ item }}
  21.       with_items:
  22.         - procps
  23.         - make
  24.         - sudo
  25.         - libcgroup
  26.         - libcgroup-devel
  27.         - php56
  28.         - php56-php-cli
  29.         - php56-php-mbstring
  30.         - php56-php-process
  31.         - gcc
  32.         - gcc-c++
  33.         - glibc-static
  34.         - java-1.7.0-openjdk
  35.         - java-1.7.0-openjdk-devel
  36.         - http://mirror.centos.org/centos/6/os/x86_64/Packages/glibc-2.12-1.209.el6.x86_64.rpm
  37.         - http://mirror.centos.org/centos/6/os/x86_64/Packages/glibc-common-2.12-1.209.el6.x86_64.rpm
  38.         - libcurl-devel
  39.         - http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/j/jsoncpp-0.10.5-2.el6.x86_64.rpm
  40.         - http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/j/jsoncpp-devel-0.10.5-2.el6.x86_64.rpm
  41.         - file-devel
  42.         - redhat-lsb
  43.         - wget
  44.         - unzip
  45.  
  46.     - name: autostart cgconfig
  47.       command: chkconfig cgconfig on
  48.  
  49.     - name: Create php symlink
  50.       file: src=/opt/remi/php56/root/usr/bin/php dest=/usr/bin/php state=link
  51.  
  52.     - name: Setting php timezone
  53.       lineinfile:
  54.         dest: /opt/remi/php56/root/etc/php.ini
  55.         regexp: ";date.timezone ="
  56.         line: "date.timezone = Asia/Jakarta"
  57.  
  58.     - name: Extracting domjudge package
  59.       unarchive: dest=~ src=https://www.domjudge.org/releases/domjudge-5.3.0.tar.gz remote_src=yes
  60.  
  61.     - name: Configure judgehost
  62.       command: ./configure --with-domjudge-user=root --with-webserver-group=root chdir=~/domjudge-5.3.0
  63.     - name: Make judgehost
  64.       command: make judgehost chdir=~/domjudge-5.3.0
  65.     - name: Make judgehost
  66.       command: make install-judgehost chdir=~/domjudge-5.3.0
  67.  
  68.     - name: Create domjudge-run group
  69.       group: name=domjudge-run
  70.     - name: Create domjudge-run user
  71.       user: name=domjudge-run home=/nonexistent createhome=no shell=/bin/false group=domjudge-run
  72.  
  73.     - name: Copying sudoers
  74.       command: cp /opt/domjudge/judgehost/etc/sudoers-domjudge /etc/sudoers.d/domjudge
  75.  
  76.     - name: Create dj_make_chroot symlink
  77.       file: src=/opt/domjudge/judgehost/bin/dj_make_chroot dest=/usr/bin/dj_make_chroot state=link
  78.  
  79.     - name: Create chroot
  80.       shell: PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/bin bin/dj_make_chroot chdir=/opt/domjudge/judgehost -y -a amd64 -D Debian creates=/chroot/domjudge/bin
  81.  
  82.     # - name: Create java chroot
  83.     #   command: bin/dj_make_ubuntu_java_chroot chdir=/opt/domjudge/judgehost -a amd64
  84.  
  85.     - name: Create cgroup
  86.       command: bin/create_cgroups chdir=/opt/domjudge/judgehost
  87.  
  88.     - name: Create configuration for domjudge api
  89.       shell: echo default {{ domjudge_api }} {{ judgehost_user }} {{ judgehost_pass }} > etc/restapi.secret chdir=/opt/domjudge/judgehost/
  90.  
  91.     - name: Create cron job
  92.       cron: special_time=reboot name=judgedaemon state=present job="/opt/domjudge/judgehost/bin/judgedaemon > ~/judgedaemon.out.log 2> ~/judgedaemon.err.log"
  93.  
  94.     - name: Reboot
  95.       shell: reboot
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top