update copr-be.cloud.fedoraproject.org.yml

copy copr-be-dev to copr-be, but preserve mount points
and remove /srv/copr-work which is no longer needed
This commit is contained in:
Miroslav Suchý 2013-10-25 09:32:26 +00:00
parent ee8363b971
commit 366ff69c67

View file

@ -15,7 +15,7 @@
hosts: 209.132.184.142
user: root
gather_facts: True
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- ${private}/vars.yml
@ -23,39 +23,68 @@
tasks:
- include: $tasks/cloud_setup_basic.yml
- include: $tasks/iptables.yml
- name: prepare mount point
action: file state=directory path=/var/lib/copr/public_html
- name: mount up disk of copr repo
action: mount name=/srv/copr-repo src='LABEL=copr-repo' fstype=ext4 state=mounted
- name: mount up disk of copr work
action: mount name=/srv/copr-work src='LABEL=copr-work' fstype=ext4 state=mounted
# open up ports (22, 80, 443)
- name: poke holes in the firewall
action: command lokkit $item
with_items:
- --service=ssh
- --service=https
- --service=http
action: mount name=/var/lib/copr/public_html src='LABEL=copr-repo' fstype=ext4 state=mounted
# We cannot use repo pointing to ourselfs :(
#- 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
- name: make copr dirs
file: state=directory path=$item
with_items:
- /var/lib/copr/jobs
- /var/lib/copr/public_html/results
- name: Umask results
action: command /usr/bin/umask 0000
chdir: /var/lib/copr/public_html/results
- name: setup dirs there
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=/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=/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=/home/copr/.ssh/config owner=copr group=copr mode=600
- name: create empty known_hosts
action: copy src=/dev/null dest=/home/copr/.ssh/known_hosts owner=copr group=copr mode=600
- name: replace bashrc for copr user
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: copy .boto file
action: copy src=$files/copr/boto dest=/home/copr/.boto owner=copr group=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
@ -73,43 +102,10 @@
- name: start webserver
action: service state=running enabled=yes name=lighttpd
- 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
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
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
- 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
- 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
- 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 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
@ -125,7 +121,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
@ -134,17 +130,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