From c0d3729ce2aaaf848e8ba0317f755b6743d13606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Thu, 3 Oct 2013 20:37:34 +0000 Subject: [PATCH] update playbooks for copr-be-dev --- files/copr/copr-be.conf | 57 +++++++++++++++++++ files/copr/copr-be.conf-dev | 57 +++++++++++++++++++ files/copr/copr_bashrc | 4 +- files/copr/lighttpd/lighttpd.conf | 2 +- files/copr/provision/ansible.cfg | 6 +- .../copr-be-dev.cloud.fedoraproject.org | 2 +- .../copr-be-dev.cloud.fedoraproject.org.yml | 51 +++++++---------- 7 files changed, 141 insertions(+), 38 deletions(-) create mode 100644 files/copr/copr-be.conf create mode 100644 files/copr/copr-be.conf-dev diff --git a/files/copr/copr-be.conf b/files/copr/copr-be.conf new file mode 100644 index 0000000000..55f4614dd0 --- /dev/null +++ b/files/copr/copr-be.conf @@ -0,0 +1,57 @@ +[backend] + +# URL where are results visible +# default is http://copr +results_baseurl=http://copr-be.cloud.fedoraproject.org/results + +# ??? What is this +# default is http://coprs/rest/api +frontend_url=http://copr-fe.cloud.fedoraproject.org/backend + +# must have same value as BACKEND_PASSWORD from have frontend in /etc/copr/copr.conf +# default is PASSWORDHERE but you really should change it. really. +frontend_auth=PASSWORDHERE + +# path to ansible playbook which spawns builder +# see /usr/share/copr*/playbooks/ for examples +# default is /etc/copr/builder_playbook.yml +spawn_playbook=/home/copr/provision/builderpb.yml + +# path to ansible playbook which terminate builder +# default is /etc/copr/terminate_playbook.yml +terminate_playbook=/home/copr/provision/terminatepb.yml + +# directory where jobs are stored +# no defaults +jobsdir=/var/lib/copr/jobs + +# directory where results are stored +# should be accessible from web using 'results_baseurl' URL +# no default +destdir=/var/lib/copr/public_html/results + +# default is 10 +sleeptime=30 + +# default is 8 +num_workers=5 + +# path to log file +# default is /var/log/copr/backend.log +logfile=/var/log/copr/backend.log + +# default is /var/log/copr/workers/ +worker_logdir=/var/log/copr/workers/ + +# exit on worker failure +# default is false +#exit_on_worker=false + +# publish fedmsg notifications from workers if true +# default is false +#fedmsg_enabled=false + + +[builder] +# default is 1800 +timeout=3600 diff --git a/files/copr/copr-be.conf-dev b/files/copr/copr-be.conf-dev new file mode 100644 index 0000000000..19dd9bbaf2 --- /dev/null +++ b/files/copr/copr-be.conf-dev @@ -0,0 +1,57 @@ +[backend] + +# URL where are results visible +# default is http://copr +results_baseurl=http://copr-be-dev.cloud.fedoraproject.org/results + +# ??? What is this +# default is http://coprs/rest/api +frontend_url=http://copr-fe-dev.cloud.fedoraproject.org/backend + +# must have same value as BACKEND_PASSWORD from have frontend in /etc/copr/copr.conf +# default is PASSWORDHERE but you really should change it. really. +frontend_auth=PASSWORDHERE + +# path to ansible playbook which spawns builder +# see /usr/share/copr*/playbooks/ for examples +# default is /etc/copr/builder_playbook.yml +spawn_playbook=/home/copr/provision/builderpb.yml + +# path to ansible playbook which terminate builder +# default is /etc/copr/terminate_playbook.yml +terminate_playbook=/home/copr/provision/terminatepb.yml + +# directory where jobs are stored +# no defaults +jobsdir=/var/lib/copr/jobs + +# directory where results are stored +# should be accessible from web using 'results_baseurl' URL +# no default +destdir=/var/lib/copr/public_html/results + +# default is 10 +sleeptime=30 + +# default is 8 +num_workers=5 + +# path to log file +# default is /var/log/copr/backend.log +logfile=/var/log/copr/backend.log + +# default is /var/log/copr/workers/ +worker_logdir=/var/log/copr/workers/ + +# exit on worker failure +# default is false +#exit_on_worker=false + +# publish fedmsg notifications from workers if true +# default is false +#fedmsg_enabled=false + + +[builder] +# default is 1800 +timeout=3600 diff --git a/files/copr/copr_bashrc b/files/copr/copr_bashrc index 6688ffedb6..ca46554b17 100644 --- a/files/copr/copr_bashrc +++ b/files/copr/copr_bashrc @@ -5,6 +5,6 @@ if [ -f /etc/bashrc ]; then . /etc/bashrc fi -if [ -f /srv/copr-work/copr/cloud/ec2rc.sh ]; then - . /srv/copr-work/copr/cloud/ec2rc.sh +if [ -f /home/copr/cloud/ec2rc.sh ]; then + . /home/copr/cloud/ec2rc.sh fi diff --git a/files/copr/lighttpd/lighttpd.conf b/files/copr/lighttpd/lighttpd.conf index e426ac1a99..a71c1befe1 100644 --- a/files/copr/lighttpd/lighttpd.conf +++ b/files/copr/lighttpd/lighttpd.conf @@ -112,7 +112,7 @@ server.groupname = "lighttpd" ## ## Document root ## -server.document-root = "/srv/copr-repo" +server.document-root = "/var/lib/copr/public_html/results" ## ## The value for the "Server:" response field. diff --git a/files/copr/provision/ansible.cfg b/files/copr/provision/ansible.cfg index 57f280e1a4..8576fa6427 100644 --- a/files/copr/provision/ansible.cfg +++ b/files/copr/provision/ansible.cfg @@ -6,11 +6,11 @@ # location of inventory file, eliminates need to specify -i -hostfile = /srv/copr-work/provision/inventory +hostfile = /home/copr/provision/inventory # location of ansible library, eliminates need to specify --module-path -library = /srv/copr-work/provision/library:/usr/share/ansible +library = /home/copr/provision/library:/usr/share/ansible # default module name used in /usr/bin/ansible when -m is not specified @@ -69,7 +69,7 @@ remote_user=root # additional plugin paths for non-core plugins -action_plugins = /usr/lib/python2.6/site-packages/ansible/runner/action_plugins:/srv/copr-work/provision/action_plugins/ +action_plugins = /usr/lib/python2.7/site-packages/ansible/runner/action_plugins:/home/copr/provision/action_plugins/ diff --git a/inventory/host_vars/copr-be-dev.cloud.fedoraproject.org b/inventory/host_vars/copr-be-dev.cloud.fedoraproject.org index 947e53ada0..24127d51bb 100644 --- a/inventory/host_vars/copr-be-dev.cloud.fedoraproject.org +++ b/inventory/host_vars/copr-be-dev.cloud.fedoraproject.org @@ -1,6 +1,6 @@ --- instance_type: m1.xlarge -image: $el6_qcow_id +image: $f19_qcow_id keypair: fedora-admin-20130801 security_group: webserver zone: nova diff --git a/playbooks/hosts/copr-be-dev.cloud.fedoraproject.org.yml b/playbooks/hosts/copr-be-dev.cloud.fedoraproject.org.yml index 0cf3e3e308..66a8edb6ae 100644 --- a/playbooks/hosts/copr-be-dev.cloud.fedoraproject.org.yml +++ b/playbooks/hosts/copr-be-dev.cloud.fedoraproject.org.yml @@ -25,20 +25,15 @@ - include: $tasks/cloud_setup_basic.yml - include: $tasks/iptables.yml + - name: copy copr.repo + action: copy src=$files/copr/fe/yum/copr.repo dest=/etc/yum.repos.d/copr.repo + # packages needed - name: add packages for copr-be action: yum state=present name=$item with_items: - - ansible - - lighttpd - - euca2ools - - rsync - - openssh-clients - - mock - - yum-utils - - createrepo - - python-bunch - - python-requests + - copr-selinux + - copr-backend - git - screen @@ -46,44 +41,34 @@ - name: make /srv dirs file: state=directory path=$item with_items: - - /srv/copr-work - - /srv/copr-repo + - /var/lib/copr/jobs + - /var/lib/copr/public_html/results - - name: make copr account - action: user name=copr state=present system=yes home=/srv/copr-work/copr - - - name: setup dirs there - action: file state=directory path=/srv/copr-work/copr/$item owner=copr group=copr mode=0700 + action: file state=directory path=/home/copr/$item owner=copr group=copr mode=0700 with_items: - cloud - .ssh - name: add copr-buildsys keys to copr user path - action: copy src=$item dest=/srv/copr-work/copr/cloud/ owner=copr group=copr mode=0600 + action: copy src=$item dest=/home/copr/cloud/ owner=copr group=copr mode=0600 with_fileglob: $private/files/openstack/copr-copr/* - name: setup privkey for copr user - action: copy src=$private/files/copr/buildsys.priv dest=/srv/copr-work/copr/.ssh/id_rsa owner=copr group=copr mode=600 + action: copy src=$private/files/copr/buildsys.priv dest=/home/copr/.ssh/id_rsa owner=copr group=copr mode=600 - name: setup copr user ssh config file - action: copy src=$files/copr/ssh_config dest=/srv/copr-work/copr/.ssh/config owner=copr group=copr mode=600 + action: copy src=$files/copr/ssh_config dest=/home/copr/.ssh/config owner=copr group=copr mode=600 - name: replace bashrc for copr user - action: copy src=$files/copr/copr_bashrc dest=/srv/copr-work/copr/.bashrc owner=copr group=copr mode=600 + action: copy src=$files/copr/copr_bashrc dest=/home/copr/.bashrc owner=copr group=copr mode=600 - name: auth_key so we can login to localhost as the copr user from the copr user action: authorized_key user=copr key="{{ item }}" with_file: - ${files}/copr/provision/files/buildsys.pub - - name: set dir ownership for copr-work and copr-repo - action: file state=directory path=$item owner=copr group=copr - with_items: - - /srv/copr-work - - /srv/copr-work/copr - # setup webserver - name: add config for copr-repo path action: copy src=$files/copr/lighttpd/lighttpd.conf dest=/etc/lighttpd/lighttpd.conf owner=root group=root mode=0644 @@ -104,7 +89,7 @@ # setup dirs for the ansible execution off of provisioning - name: dirs from provision - action: file state=directory path=/srv/copr-work/provision/$item owner=copr group=copr + action: file state=directory path=/home/copr/provision/$item owner=copr group=copr with_items: - action_plugins - library @@ -120,7 +105,7 @@ - name: put some files into the provision subdir - action: copy src=$files/copr/provision/$item dest=/srv/copr-work/provision/$item + action: copy src=$files/copr/provision/$item dest=/home/copr/provision/$item with_items: - inventory - builderpb.yml @@ -129,17 +114,21 @@ - provision_config - name: put files into the files subdir off of provisioning - action: copy src=$item dest=/srv/copr-work/provision/files/ + action: copy src=$item dest=/home/copr/provision/files/ with_fileglob: $files/copr/provision/files/* tags: - provision_config # ansible lacks a recurse - so we need this until then - name: put files into the files/mock subdir off of provisioning - action: copy src=$item dest=/srv/copr-work/provision/files/mock + action: copy src=$item dest=/home/copr/provision/files/mock with_fileglob: $files/copr/provision/files/mock/* tags: - provision_config + - name: copy copr-be.conf + action: copy src=$files/copr/copr-be.conf-dev dest=/etc/copr/copr-be.conf + handlers: - include: $handlers/restart_services.yml +