From f8db3b391b3b445fbb8643212d48d03f61fe5f06 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Tue, 30 Oct 2018 15:12:48 +0100 Subject: [PATCH] Drop the ccsdb role Signed-off-by: Pierre-Yves Chibon --- roles/ccsdb/tasks/main.yml | 74 -------------------------------- roles/ccsdb/templates/ccsdb.cfg | 7 --- roles/ccsdb/templates/ccsdb.conf | 27 ------------ roles/ccsdb/templates/ccsdb.wsgi | 4 -- 4 files changed, 112 deletions(-) delete mode 100644 roles/ccsdb/tasks/main.yml delete mode 100644 roles/ccsdb/templates/ccsdb.cfg delete mode 100644 roles/ccsdb/templates/ccsdb.conf delete mode 100644 roles/ccsdb/templates/ccsdb.wsgi diff --git a/roles/ccsdb/tasks/main.yml b/roles/ccsdb/tasks/main.yml deleted file mode 100644 index d89b6699af..0000000000 --- a/roles/ccsdb/tasks/main.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -- name: install ccsdb and its dependencies - package: name={{ item }} state=present - with_items: - - ccsdb - - mod_wsgi - - python-psycopg2 - - libsemanage-python - when: ansible_distribution_major_version|int < 22 - -- name: install ccsdb and its dependencies - dnf: name={{ item }} state=present - with_items: - - ccsdb - - mod_wsgi - - python-psycopg2 - - libsemanage-python - when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined - -- name: ensure database is created - delegate_to: "{{ ccsdb_db_host_machine }}" - become_user: postgres - become: true - postgresql_db: db={{ ccsdb_db_name }} - -- name: ensure ccsdb db user has access to database - delegate_to: "{{ ccsdb_db_host_machine }}" - become_user: postgres - become: true - postgresql_user: db={{ ccsdb_db_name }} - user={{ ccsdb_db_user }} - password={{ ccsdb_db_password }} - role_attr_flags=NOSUPERUSER - -- name: ensure selinux lets httpd talk to postgres - seboolean: name=httpd_can_network_connect_db persistent=yes state=yes - -- name: create the /etc/ccsdb folder - file: state=directory - path=/etc/ccsdb - owner=root group=root mode=0755 - -- name: generate ccsdb config - template: src=ccsdb.cfg dest=/etc/ccsdb/ccsdb.cfg - owner=root group=root mode=0644 - notify: - - reload httpd - -- name: generate ccsdb apache config - template: src=ccsdb.conf dest=/etc/httpd/conf.d/ccsdb.conf - owner=root group=root mode=0644 - notify: - - reload httpd - -- name: create the /usr/share/ccsdb folder - file: state=directory - path=/usr/share/ccsdb - owner=root group=root mode=0755 - -- name: install the wsgi file - template: src=ccsdb.wsgi dest=/usr/share/ccsdb/ccsdb.wsgi - owner=root group=root mode=0644 - notify: - - reload httpd - -- name: initialize execdb database - shell: CCSDB_CONFIG=/etc/ccsdb/ccsdb.cfg ccsdb-cli init_db - -- name: Start and enable the different services required - service: name={{ item }} enabled=yes state=started - with_items: - - httpd - - fedmsg-hub - diff --git a/roles/ccsdb/templates/ccsdb.cfg b/roles/ccsdb/templates/ccsdb.cfg deleted file mode 100644 index 4de44cf9e4..0000000000 --- a/roles/ccsdb/templates/ccsdb.cfg +++ /dev/null @@ -1,7 +0,0 @@ -SECRET_KEY = '{{ ccsdb_secret_key }}' -SQLALCHEMY_DATABASE_URI = 'postgresql://{{ ccsdb_db_user }}:{{ ccsdb_db_password }}@{{ ccsdb_db_host }}:{{ ccsdb_db_port }}/{{ ccsdb_db_name }}' - -FILE_LOGGING = False -LOGFILR = '/var/log/ccsdb/ccsdb.log' -SYSLOG_LOGGING = False -STREAM_LOGGING = True diff --git a/roles/ccsdb/templates/ccsdb.conf b/roles/ccsdb/templates/ccsdb.conf deleted file mode 100644 index 7863c4fcf8..0000000000 --- a/roles/ccsdb/templates/ccsdb.conf +++ /dev/null @@ -1,27 +0,0 @@ -WSGIDaemonProcess ccsdb user=apache group=apache threads=5 -WSGIScriptAlias /{{ ccsdb_endpoint }} /usr/share/ccsdb/ccsdb.wsgi -WSGISocketPrefix run/wsgi - -# this isn't the best way to force SSL but it works for now -#RewriteEngine On -#RewriteCond %{HTTPS} !=on -#RewriteRule ^/execdb/admin/?(.*) https://%{SERVER_NAME}/$1 [R,L] - - - WSGIProcessGroup ccsdb - WSGIApplicationGroup %{GLOBAL} - WSGIScriptReloading On - - # Apache 2.4 - - Require method GET - Require ip 127.0.0.1 ::1{% for host in allowed_hosts %} {{ host }}{% endfor %} - - - - - Order allow,deny - Allow from all - - - diff --git a/roles/ccsdb/templates/ccsdb.wsgi b/roles/ccsdb/templates/ccsdb.wsgi deleted file mode 100644 index 3df7ec863b..0000000000 --- a/roles/ccsdb/templates/ccsdb.wsgi +++ /dev/null @@ -1,4 +0,0 @@ -import os -os.environ['CCSDB_CONFIG'] = '/etc/ccsdb/ccsdb.cfg' - -from ccsdb.app import _app as application