From 672d0063e8f7a07c8f925f23c77edd884a787c55 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 27 Aug 2018 19:49:06 +0000 Subject: [PATCH] Further cleanup of copr/frontend role --- roles/copr/frontend/tasks/main.yml | 56 +++++++++---------- .../frontend/templates/{httpd => }/coprs.conf | 0 2 files changed, 27 insertions(+), 29 deletions(-) rename roles/copr/frontend/templates/{httpd => }/coprs.conf (100%) diff --git a/roles/copr/frontend/tasks/main.yml b/roles/copr/frontend/tasks/main.yml index b4c9b5bb98..d3b43db0c3 100644 --- a/roles/copr/frontend/tasks/main.yml +++ b/roles/copr/frontend/tasks/main.yml @@ -1,6 +1,6 @@ --- -- name: install copr-frontend and copr-selinux - dnf: state=latest name={{ item }} +- name: install copr-frontend packages + package: name={{ item }} state=present with_items: - copr-frontend - copr-selinux @@ -9,30 +9,23 @@ tags: - packages - # we install python-alembic because https://bugzilla.redhat.com/show_bug.cgi?id=1536058 -- name: install additional pkgs for copr-frontend - dnf: state=present pkg={{ item }} - with_items: - - redis - - python3-alembic - tags: - - packages - - name: install copr configs - template: src="copr.conf" dest=/etc/copr/copr.conf mode=600 + template: src=copr.conf dest=/etc/copr/copr.conf mode=600 notify: - reload httpd tags: - config -- name: enable and start pagure-events - service: name=pagure-events enabled=yes state=started - when: not 'pagure-events.service is missing in latest copr-frontend rpm in f28 repos' - - name: copy apache files to conf.d (templates) - template: src="httpd/{{ item }}" dest="/etc/httpd/conf.d/{{ item }}" - with_items: - - "coprs.conf" + template: src=coprs.conf dest=/etc/httpd/conf.d/coprs.conf + notify: + - reload httpd + tags: + - config + +- name: set staging banner for staging instance + when: env == 'staging' + copy: src=banner-include.html dest=/var/lib/copr/ tags: - config @@ -42,6 +35,19 @@ name: httpd_execmem state: yes persistent: yes + tags: + - selinux + +- name: enable and start httpd + service: name=httpd state=started enabled=yes + tags: + - service + +- name: enable and start pagure-events + service: name=pagure-events enabled=yes state=started + when: not 'pagure-events.service is missing in latest copr-frontend rpm in f28 repos' + tags: + - service - name: set up admins command: ./manage.py alter_user --admin {{ item }} @@ -49,7 +55,7 @@ become_user: copr-fe args: chdir: /usr/share/copr/coprs_frontend/ - ignore_errors: yes + when: False with_items: - msuchy - sgallagh @@ -57,18 +63,10 @@ - nb - kevin -- name: enable services - service: state=started enabled=yes name={{ item }} - with_items: - - httpd - -- name: set staging banner for staging instance - when: env == 'staging' - copy: src=banner-include.html dest=/var/lib/copr/ - - name: rebuild indexes command: ./manage.py update_indexes become: yes become_user: copr-fe args: chdir: /usr/share/copr/coprs_frontend/ + when: False diff --git a/roles/copr/frontend/templates/httpd/coprs.conf b/roles/copr/frontend/templates/coprs.conf similarity index 100% rename from roles/copr/frontend/templates/httpd/coprs.conf rename to roles/copr/frontend/templates/coprs.conf