diff --git a/roles/copr/backend/templates/provision/builderpb-fedora.yml b/roles/copr/backend/templates/provision/builderpb-fedora.yml deleted file mode 100644 index ac866b5fa1..0000000000 --- a/roles/copr/backend/templates/provision/builderpb-fedora.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -- name: check/create instance - hosts: localhost - user: copr - gather_facts: False - - vars: - - security_group: builder - - OS_AUTH_URL: http://172.23.0.2:5000/v2.0 - - OS_TENANT_NAME: copr - - OS_USERNAME: msuchy - - OS_PASSWORD: {{ copr_nova_password }} - # fedora 21 cloud - - image_id: b6589620-36a4-42d4-beea-e34be5b0ae50 - - - tasks: - - name: generate builder name - local_action: command echo "Copr builder {{ 999999999 | random }}" - register: vm_name - - - name: spin it up - local_action: nova_compute auth_url={{OS_AUTH_URL}} flavor_id=6 image_id={{ image_id }} key_name=buildsys login_password={{OS_PASSWORD}} login_tenant_name={{OS_TENANT_NAME}} login_username={{OS_USERNAME}} security_groups={{security_group}} wait=yes name="{{vm_name.stdout}}" - register: nova - - # should be able to use nova.private_ip, but it does not work with Fedora Cloud. - - debug: msg="IP={{ nova.info.addresses.vlannet_3[0].addr }}" - - - debug: msg="vm_name={{vm_name.stdout}}" - - - name: add it to the special group - local_action: add_host hostname={{ nova.info.addresses.vlannet_3[0].addr }} groupname=builder_temp_group - - - name: wait for the host to be hot - local_action: wait_for host={{ nova.info.addresses.vlannet_3[0].addr }} port=22 delay=5 timeout=600 - - - name: pause a bit for cloud-init - pause: seconds=30 - -- hosts: builder_temp_group - user: fedora - sudo: True - gather_facts: False - vars: - - files: files/ - - tasks: - - name: edit hostname to be instance name - action: shell hostname `curl -s http://169.254.169.254/2009-04-04/meta-data/instance-id` - - - name: install pkgs - action: yum state=present pkg={{ item }} - with_items: - - rsync - - openssh-clients - - libselinux-python - - libsemanage-python - - mock - - createrepo - - yum-utils - - pyliblzma - - - name: make sure newest rpm - action: yum name={{ item }} state=latest - with_items: - - rpm - - glib2 - - ca-certificates - - - name: mockbuilder user - action: user name=mockbuilder groups=mock - - - name: mockbuilder .ssh - action: file state=directory path=/home/mockbuilder/.ssh mode=0700 owner=mockbuilder group=mockbuilder - - - name: mockbuilder authorized_keys - action: authorized_key user=mockbuilder key='{{ lookup('file', '/home/copr/provision/files/buildsys.pub') }}' - - - name: root authorized_keys - action: authorized_key user=root key='{{ lookup('file', '/home/copr/provision/files/buildsys.pub') }}' - - - name: put updated mock configs into /etc/mock - action: copy src={{ files }}/mock/{{ item }} dest=/etc/mock - with_items: - - site-defaults.cfg - - - lineinfile: dest=/etc/mock/fedora-rawhide-x86_64.cfg line="config_opts['package_manager'] = 'dnf'" state=absent - - lineinfile: dest=/etc/mock/fedora-rawhide-i386.cfg line="config_opts['package_manager'] = 'dnf'" state=absent - - - lineinfile: dest=/etc/security/limits.conf line="* soft nofile 10240" insertafter=EOF - - lineinfile: dest=/etc/security/limits.conf line="* hard nofile 10240" insertafter=EOF diff --git a/roles/copr/backend/templates/provision/builderpb.yml b/roles/copr/backend/templates/provision/builderpb.yml deleted file mode 100644 index fef8c64b7b..0000000000 --- a/roles/copr/backend/templates/provision/builderpb.yml +++ /dev/null @@ -1,97 +0,0 @@ ---- -- name: check/create instance - hosts: localhost - user: copr - gather_facts: False - - vars: - - security_group: builder - - OS_AUTH_URL: http://172.23.0.2:5000/v2.0 - - OS_TENANT_NAME: copr - - OS_USERNAME: msuchy - - OS_PASSWORD: {{ copr_nova_password }} - # rhel 6.4 2013-02-21 x86_64 - ami - - image_id: cba0c766-84ac-4048-b0f5-6d4000af62f8 - - {% raw %} - tasks: - - name: generate builder name - local_action: command echo "Copr builder {{ 999999999 | random }}" - register: vm_name - - - name: spin it up - local_action: nova_compute auth_url={{OS_AUTH_URL}} flavor_id=6 image_id={{ image_id }} key_name=buildsys login_password={{OS_PASSWORD}} login_tenant_name={{OS_TENANT_NAME}} login_username={{OS_USERNAME}} security_groups={{security_group}} wait=yes name="{{vm_name.stdout}}" - register: nova - - # should be able to use nova.private_ip, but it does not work with Fedora Cloud. - - debug: msg="IP={{ nova.info.addresses.vlannet_3[0].addr }}" - - - debug: msg="vm_name={{vm_name.stdout}}" - - - name: add it to the special group - local_action: add_host hostname={{ nova.info.addresses.vlannet_3[0].addr }} groupname=builder_temp_group - - - name: wait for the host to be hot - local_action: wait_for host={{ nova.info.addresses.vlannet_3[0].addr }} port=22 delay=5 timeout=600 - -- hosts: builder_temp_group - user: root - gather_facts: False - vars: - - files: files/ - - tasks: - - name: edit hostname to be instance name - action: shell hostname `curl -s http://169.254.169.254/2009-04-04/meta-data/instance-id` - - - name: install pkgs - action: yum state=present pkg={{ item }} - with_items: - - rsync - - openssh-clients - - libselinux-python - - libsemanage-python - - - name: add repos - action: copy src={{ files }}/{{ item }} dest=/etc/yum.repos.d/{{ item }} - with_items: - - builder.repo - - epel6.repo - - - name: install additional pkgs - action: yum state=present pkg={{ item }} - with_items: - - mock - - createrepo - - yum-utils - - pyliblzma - - - name: make sure newest rpm - action: yum name={{ item }} state=latest - with_items: - - rpm - - glib2 - - ca-certificates - - - yum: name=mock enablerepo=epel-testing state=latest - - - name: mockbuilder user - action: user name=mockbuilder groups=mock - - - name: mockbuilder .ssh - action: file state=directory path=/home/mockbuilder/.ssh mode=0700 owner=mockbuilder group=mockbuilder - - - name: mockbuilder authorized_keys - action: authorized_key user=mockbuilder key='{{ lookup('file', '/home/copr/provision/files/buildsys.pub') }}' - - - name: put updated mock configs into /etc/mock - action: copy src={{ files }}/mock/{{ item }} dest=/etc/mock - with_items: - - site-defaults.cfg - - - lineinfile: dest=/etc/mock/fedora-rawhide-x86_64.cfg line="config_opts['package_manager'] = 'dnf'" state=absent - - lineinfile: dest=/etc/mock/fedora-rawhide-i386.cfg line="config_opts['package_manager'] = 'dnf'" state=absent - - - lineinfile: dest=/etc/security/limits.conf line="* soft nofile 10240" insertafter=EOF - - lineinfile: dest=/etc/security/limits.conf line="* hard nofile 10240" insertafter=EOF -{% endraw %} diff --git a/roles/copr/base/tasks/main.yml b/roles/copr/base/tasks/main.yml index d825501d18..a0383a9ec3 100644 --- a/roles/copr/base/tasks/main.yml +++ b/roles/copr/base/tasks/main.yml @@ -43,6 +43,11 @@ tags: - packages +- name: make sure our resolv.conf is the one being used - set PEERDNS=no in /etc/sysconfig/network + lineinfile: dest=/etc/sysconfig/network create=yes backup=yes state=present line='PEERDNS=no' regexp=^PEERDNS= + tags: + - config + - name: enable services service: state=running enabled=yes name={{ item }} with_items: diff --git a/roles/copr/frontend/tasks/main.yml b/roles/copr/frontend/tasks/main.yml index a804c780a4..4a46302763 100644 --- a/roles/copr/frontend/tasks/main.yml +++ b/roles/copr/frontend/tasks/main.yml @@ -52,7 +52,7 @@ chdir: /usr/share/copr/coprs_frontend/ - name: set up chroots - command: ./manage.py create_chroot epel-5-i386 epel-5-x86_64 epel-6-i386 epel-6-x86_64 epel-7-x86_64 fedora-20-i386 fedora-20-x86_64 fedora-21-xi386 fedora-21-x86_64 fedora-22-i386 fedora-22-x86_64 fedora-rawhide-i386 fedora-rawhide-x86_64 + command: ./manage.py create_chroot epel-5-i386 epel-5-x86_64 epel-6-i386 epel-6-x86_64 epel-7-x86_64 fedora-20-i386 fedora-20-x86_64 fedora-21-i386 fedora-21-x86_64 fedora-22-i386 fedora-22-x86_64 fedora-rawhide-i386 fedora-rawhide-x86_64 sudo: yes sudo_user: copr-fe args: