diff --git a/ghn-gcore/gcore-authorization/defaults/main.yml b/ghn-gcore/gcore-authorization/defaults/main.yml deleted file mode 100644 index 00403c9d..00000000 --- a/ghn-gcore/gcore-authorization/defaults/main.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -#authorization_service_install: False -#authorization_service_upgrade: False -authorization_service_name: authorization-service -#authorization_service_file: '{{ authorization_service_name }}-2.0.0-20160927.120833-1.war' -#authorization_service_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/gcube-snapshots/org/gcube/common/authorization-service/2.0.0-SNAPSHOT/{{ authorization_service_file }}' -# -#authorization_version: "2.0.1-4.2.0-134808" -authorization_service_version: "2.0.1-4.2.0-134808" - -repo: "gcube-staging" -authorization_service_file: '{{ authorization_service_name }}-{{ authorization_service_version }}.war' -authorization_service_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ repo }}/org/gcube/common/authorization-service/{{ authorization_service_version }}/{{ authorization_service_file }}' -authorization_service_persistence_dest: WEB-INF/classes/META-INF/persistence.xml -authorization_service_config_dest: WEB-INF/AuthorizationConfiguration.xml -#auth_user: '{{ d4science_user }}' -tomcat_user: "tomcat" -tomcat_document_root: "/usr/share/tomcat/" -authorization_service_loglevel: INFO -authorization_service_root_loglevel: WARN -#authorization_service_http_port: 8080 -authorization_service_http_port: 80 -authorized_ips: -# - 127.0.0.1 - - 0.0.0.0 - -auth_postgresql_host: "localhost" -psql_db_name: "gcoreauthz" -psql_db_user: "gcoreauthz" -authorization_db_pwd: "gcore-authz" -postgres_port: "5431" -pgpool_port: "5432" diff --git a/ghn-gcore/gcore-authorization/meta/main.yml b/ghn-gcore/gcore-authorization/meta/main.yml deleted file mode 100644 index c136f5b7..00000000 --- a/ghn-gcore/gcore-authorization/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ -dependencies: - - role: tomcat - - role: postgresql - - role: pgpool diff --git a/ghn-gcore/gcore-authorization/tasks/main.yml b/ghn-gcore/gcore-authorization/tasks/main.yml deleted file mode 100644 index c2b6d380..00000000 --- a/ghn-gcore/gcore-authorization/tasks/main.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- -- block: - - name: Ensure that postgres is running - service: name=postgresql state=started - - - name: Create postgres database {{ psql_db_name }} and user {{ psql_db_user }} - shell: sudo -u postgres createdb {{ psql_db_name }} && sudo -u postgres createuser -s {{ psql_db_user }} - ignore_errors: True - - - name: Set password for user {{ psql_db_user }} and grant all privileges on database {{ psql_db_name }} - shell: sudo -u postgres psql -c "ALTER USER {{ psql_db_user }} WITH PASSWORD '{{ authorization_db_pwd }}';" && sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE {{ psql_db_name }} TO {{ psql_db_user }}"; - ignore_errors: True - - - name: Change postgres authentication method to password for localhost - lineinfile: dest=/var/lib/pgsql/data/pg_hba.conf state=present regexp='^host all all 127.0.0.1/32' line='host all all 127.0.0.1/32 password' - - - name: Change postgres authentication method to password for localhost ipv6 - lineinfile: dest=/var/lib/pgsql/data/pg_hba.conf state=present regexp='^host all all ::1/128' line='host all all ::1/128 password' - - - name: Change postgres port to {{ postgres_port }} - lineinfile: dest="/usr/lib/systemd/system/postgresql.service" state=present regexp='^Environment=PGPORT=' line='Environment=PGPORT={{ postgres_port }}' - - - name: Change pgpool port to {{ pgpool_port }} - lineinfile: dest="/etc/pgpool-II/pgpool.conf" state=present regexp='^port =' line='port = {{ pgpool_port }}' - - - name: Tell pgpool to connect to postgreqsl on port {{ postgres_port }} - lineinfile: dest="/etc/pgpool-II/pgpool.conf" state=present regexp='^backend_port0 =' line='backend_port0 = {{ postgres_port }}' - - - name: Tell pgpool to enable ssl - lineinfile: dest="/etc/pgpool-II/pgpool.conf" state=present regexp='^ssl = on' line='ssl = on' - - - name: Running semanage to enable postgres to bind port {{ postgres_port }} - seport: ports={{ postgres_port }} proto=tcp setype=postgresql_port_t state=present reload=yes - - - name: Running setsebool to allow tcp connections to the db - seboolean: name=httpd_can_network_connect_db state=yes persistent=yes - -# - name: restart postgres -# service: name=postgresql state=restarted - - #### on CentOS 7 we need to tell systemd to reload the service file since we made changes there - - name: restart postgresql - systemd: name=postgresql state=restarted enabled=yes daemon_reload=yes - - - name: restart pgpool - service: name=pgpool state=restarted - - - name: Stop tomcat when upgrading - service: name=tomcat state=stopped - - - name: Create the authorization service webapp directory - file: dest={{ tomcat_document_root }}/webapps/authorization-service state=directory owner={{ tomcat_user }} group={{ tomcat_user }} - - - name: Get and unpack the authorization war file - unarchive: copy=no src={{ authorization_service_url }} dest={{ tomcat_document_root }}/webapps/authorization-service owner={{ tomcat_user }} group={{ tomcat_user }} - args: - creates: '{{ tomcat_document_root }}/webapps/authorization-service/WEB-INF/AuthorizationConfiguration.xml' - - - name: Install the authorization service AuthorizationConfiguration.xml template - template: src=AuthorizationConfiguration.xml.j2 dest={{ tomcat_document_root }}/webapps/authorization-service/{{ authorization_service_config_dest }} mode=0440 owner={{ tomcat_user }} group={{ tomcat_user }} - - - name: Install the authorization service persistence.xml template - template: src=persistence.xml.j2 dest={{ tomcat_document_root }}/webapps/authorization-service/{{ authorization_service_persistence_dest }} mode=0440 owner={{ tomcat_user }} group={{ tomcat_user }} - - - name: Install the logback configuration - template: src=logback.xml.j2 dest={{ tomcat_document_root }}/lib/logback.xml mode=0644 owner={{ tomcat_user }} group={{ tomcat_user }} - -# - name: restore ownership -# file: dest={{ tomcat_document_root }} owner=root group=tomcat recurse=yes - - - name: Start tomcat - service: name=tomcat state=started - - become: true - become_user: root diff --git a/ghn-gcore/gcore-authorization/templates/AuthorizationConfiguration.xml.j2 b/ghn-gcore/gcore-authorization/templates/AuthorizationConfiguration.xml.j2 deleted file mode 100644 index 269d41c1..00000000 --- a/ghn-gcore/gcore-authorization/templates/AuthorizationConfiguration.xml.j2 +++ /dev/null @@ -1,24 +0,0 @@ - - - - {% for ip in authorized_ips %} - - {% endfor %} - - - - - {% for ip in authorized_ips %} - - {% endfor %} - - - - - - {% for ip in authorized_ips %} - - {% endfor %} - - - diff --git a/ghn-gcore/gcore-authorization/templates/logback.xml.j2 b/ghn-gcore/gcore-authorization/templates/logback.xml.j2 deleted file mode 100644 index c405cf2b..00000000 --- a/ghn-gcore/gcore-authorization/templates/logback.xml.j2 +++ /dev/null @@ -1,24 +0,0 @@ - - - - - ${catalina.base}/logs/ghn.log - true - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}: %msg%n - - - - ${catalina.base}/logs/ghn.%d{yyyy-MM-dd}.log - 30 - - - - - - - - - - - diff --git a/ghn-gcore/gcore-authorization/templates/persistence.xml.j2 b/ghn-gcore/gcore-authorization/templates/persistence.xml.j2 deleted file mode 100644 index 3ad39bc0..00000000 --- a/ghn-gcore/gcore-authorization/templates/persistence.xml.j2 +++ /dev/null @@ -1,33 +0,0 @@ - - - - - org.eclipse.persistence.jpa.PersistenceProvider - - - org.gcube.common.authorizationservice.persistence.entities.converters.StringListConverter - - - - org.gcube.common.authorizationservice.persistence.entities.AuthorizationEntity - org.gcube.common.authorizationservice.persistence.entities.ServiceAuthorizationEntity - org.gcube.common.authorizationservice.persistence.entities.UserAuthorizationEntity - org.gcube.common.authorizationservice.persistence.entities.ExternalServiceAuthorizationEntity - org.gcube.common.authorizationservice.persistence.entities.NodeAuthorizationEntity - org.gcube.common.authorizationservice.persistence.entities.PolicyEntity - org.gcube.common.authorizationservice.persistence.entities.ServicePolicyEntity - org.gcube.common.authorizationservice.persistence.entities.UserPolicyEntity - - - - - - - - - -