From 43e66566d7d73a222327dcb56a9afe1a31757ef0 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 7 Jul 2014 12:10:35 +0200 Subject: [PATCH 01/21] Added Ansible role --- .../resources/ansible-openconext-api/meta/main.yml | 13 +++++++++++++ .../ansible-openconext-api/tasks/erase.yml | 0 .../resources/ansible-openconext-api/tasks/main.yml | 0 .../tasks/main/install-src.yml | 0 .../ansible-openconext-api/tasks/main/install.yml | 0 .../ansible-openconext-api/tasks/version.yml | 0 6 files changed, 13 insertions(+) create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/tasks/erase.yml create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/tasks/version.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml new file mode 100644 index 0000000..63d46e5 --- /dev/null +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml @@ -0,0 +1,13 @@ +--- +galaxy_info: + author: Boy Baukema + license: Apache v2 + min_ansible_version: 1.6 + platforms: + - name: EL + versions: + - 6 + categories: + - web +dependencies: [] +version: 4.2.0 \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/erase.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/erase.yml new file mode 100644 index 0000000..e69de29 diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml new file mode 100644 index 0000000..e69de29 diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml new file mode 100644 index 0000000..e69de29 diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml new file mode 100644 index 0000000..e69de29 diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/version.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/version.yml new file mode 100644 index 0000000..e69de29 From 4592c979da590f5f0ddf8432bd526347c9e36c5e Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 7 Jul 2014 17:03:12 +0200 Subject: [PATCH 02/21] Work in progress on Ansible Role --- .../ansible-openconext-api/tasks/main.yml | 8 ++++++ .../tasks/main/install-build.yml | 3 +++ .../tasks/main/install-src.yml | 15 +++++++++++ .../tasks/main/install.yml | 27 +++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-build.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml index e69de29..289acbb 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml @@ -0,0 +1,8 @@ +--- + - name: Install API + include: main/install.yml + + - name: Configure API + + - name: Activate API + notify: Restart Tomcat \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-build.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-build.yml new file mode 100644 index 0000000..a2f63c1 --- /dev/null +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-build.yml @@ -0,0 +1,3 @@ +--- + - name: Get the current release from build URL. + get_url: url="{{ api_download_url }}" dest="{{ api_build_path }}" \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml index e69de29..a783406 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml @@ -0,0 +1,15 @@ +--- + - name: SRC - Install Git repo + git: + accept_hostkey: yes + repo: "{{ api_git_url }}" + dest: "{{ api_release_dir }}" + version: "{{ api_version }}" + + - name: SRC - Running Maven install + command: mvn clean install -DskipTests + args: + chdir: "{{ api_release_dir }}" + + - name: SRC - Copy build to build directory + copy: src="coin-api-dist/target/coin-api-dist-{{ version }}-bin.tar.gz" dest={{ api_build_path }} \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml index e69de29..5e68035 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml @@ -0,0 +1,27 @@ +--- + - name: Install API from Build (only when version starts with a number) + include: install-build.yml + when: api_version | match("^[0-9]") + + - name: Install API from source (only when version does not start with a number) + include: install-src.yml + when: api_version | match("^[^0-9]") + + - name: Extract build + unarchive: src={{ api_build_path }} dest={{ releases_dir }} copy=no + + - name: Stop the application server + service: name=tomcat6 state=stopped + + - name: Setup Tomcat wars + file: path="/usr/share/tomcat6/wars" state=directory + + - name: Remove old wars + shell: rm -vf /usr/share/tomcat6/wars/coin-api-war-*.war + + - name: Remove + cd ../work/Catalina + rm -rf api.(dev/test/acc/prod).surfconext.nl/* + + cd ../../webapps/ + rm -rf api.(dev/test/acc/prod).surfconext.nl/* \ No newline at end of file From c4f0b13450bfab3180706baf7a5a57525dcf6e59 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 7 Jul 2014 17:36:32 +0200 Subject: [PATCH 03/21] Work on API provisioning --- .../ansible-openconext-api/tasks/main.yml | 3 ++- .../tasks/main/configure.yml | 2 ++ .../tasks/main/install.yml | 23 +++++++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml index 289acbb..9f26e2a 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml @@ -3,6 +3,7 @@ include: main/install.yml - name: Configure API + include: main/configure.yml - name: Activate API - notify: Restart Tomcat \ No newline at end of file + service: name=tomcat6 state=restarted \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml new file mode 100644 index 0000000..3e42bcb --- /dev/null +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml @@ -0,0 +1,2 @@ +--- + - name: \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml index 5e68035..ba54f84 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml @@ -13,15 +13,20 @@ - name: Stop the application server service: name=tomcat6 state=stopped - - name: Setup Tomcat wars - file: path="/usr/share/tomcat6/wars" state=directory + - name: Install Tomcat wars directory + file: path={{ tomcat_wars_path }} owner=tomcat group=tomcat recurse=true state=directory - - name: Remove old wars - shell: rm -vf /usr/share/tomcat6/wars/coin-api-war-*.war + - name: Clean Tomcat old wars + shell: rm -vf {{ tomcat_wars_path }}/coin-api-war-*.war - - name: Remove - cd ../work/Catalina - rm -rf api.(dev/test/acc/prod).surfconext.nl/* + - name: Install Tomcat work directory + file: path={{ tomcat_work_path }} owner=tomcat group=tomcat recurse=true state=directory - cd ../../webapps/ - rm -rf api.(dev/test/acc/prod).surfconext.nl/* \ No newline at end of file + - name: Clean Tomcat work + shell: rm -rvf {{ tomcat_work_path }}/api.{{ openconext_domain }}/* + + - name: Install Tomcat webapps directory + file: path={{ tomcat_webapps_path }} owner=tomcat group=tomcat recurse=true state=directory + + - name: Clean Tomcat webapps + shell: rm -rvf {{ tomcat_webapps_path }}/api.{{ openconext_domain }}/* \ No newline at end of file From 1fa52e4e0942754a08c5233fd4a70f6c00ea52d9 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Tue, 8 Jul 2014 14:10:58 +0200 Subject: [PATCH 04/21] Refactored names of tomcat template files to keep proper extension (for syntax highlighting / detection by tools such as GitHub and IntelliJ) and added some whitespace to caching configuration to make it more readable. --- ...pi-ehcache.xml.acc => api-ehcache.acc.xml} | 0 ...-ehcache.xml.prod => api-ehcache.prod.xml} | 0 ...-ehcache.xml.test => api-ehcache.test.xml} | 0 .../main/resources/tomcat/api-ehcache.vm.xml | 29 +++++++++++++++++++ .../main/resources/tomcat/api-ehcache.xml.vm | 12 -------- ...pi-logback.xml.acc => api-logback.acc.xml} | 0 ...-logback.xml.prod => api-logback.prod.xml} | 0 ...-logback.xml.test => api-logback.test.xml} | 0 ...{api-logback.xml.vm => api-logback.vm.xml} | 0 ...properties.acc => coin-api.acc.properties} | 0 ...operties.prod => coin-api.prod.properties} | 0 ...operties.test => coin-api.test.properties} | 0 ...i.properties.vm => coin-api.vm.properties} | 0 13 files changed, 29 insertions(+), 12 deletions(-) rename coin-api-dist/src/main/resources/tomcat/{api-ehcache.xml.acc => api-ehcache.acc.xml} (100%) rename coin-api-dist/src/main/resources/tomcat/{api-ehcache.xml.prod => api-ehcache.prod.xml} (100%) rename coin-api-dist/src/main/resources/tomcat/{api-ehcache.xml.test => api-ehcache.test.xml} (100%) create mode 100644 coin-api-dist/src/main/resources/tomcat/api-ehcache.vm.xml delete mode 100644 coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.vm rename coin-api-dist/src/main/resources/tomcat/{api-logback.xml.acc => api-logback.acc.xml} (100%) rename coin-api-dist/src/main/resources/tomcat/{api-logback.xml.prod => api-logback.prod.xml} (100%) rename coin-api-dist/src/main/resources/tomcat/{api-logback.xml.test => api-logback.test.xml} (100%) rename coin-api-dist/src/main/resources/tomcat/{api-logback.xml.vm => api-logback.vm.xml} (100%) rename coin-api-dist/src/main/resources/tomcat/{coin-api.properties.acc => coin-api.acc.properties} (100%) rename coin-api-dist/src/main/resources/tomcat/{coin-api.properties.prod => coin-api.prod.properties} (100%) rename coin-api-dist/src/main/resources/tomcat/{coin-api.properties.test => coin-api.test.properties} (100%) rename coin-api-dist/src/main/resources/tomcat/{coin-api.properties.vm => coin-api.vm.properties} (100%) diff --git a/coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.acc b/coin-api-dist/src/main/resources/tomcat/api-ehcache.acc.xml similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.acc rename to coin-api-dist/src/main/resources/tomcat/api-ehcache.acc.xml diff --git a/coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.prod b/coin-api-dist/src/main/resources/tomcat/api-ehcache.prod.xml similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.prod rename to coin-api-dist/src/main/resources/tomcat/api-ehcache.prod.xml diff --git a/coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.test b/coin-api-dist/src/main/resources/tomcat/api-ehcache.test.xml similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.test rename to coin-api-dist/src/main/resources/tomcat/api-ehcache.test.xml diff --git a/coin-api-dist/src/main/resources/tomcat/api-ehcache.vm.xml b/coin-api-dist/src/main/resources/tomcat/api-ehcache.vm.xml new file mode 100644 index 0000000..929fcf4 --- /dev/null +++ b/coin-api-dist/src/main/resources/tomcat/api-ehcache.vm.xml @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.vm b/coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.vm deleted file mode 100644 index a752e8f..0000000 --- a/coin-api-dist/src/main/resources/tomcat/api-ehcache.xml.vm +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/api-logback.xml.acc b/coin-api-dist/src/main/resources/tomcat/api-logback.acc.xml similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/api-logback.xml.acc rename to coin-api-dist/src/main/resources/tomcat/api-logback.acc.xml diff --git a/coin-api-dist/src/main/resources/tomcat/api-logback.xml.prod b/coin-api-dist/src/main/resources/tomcat/api-logback.prod.xml similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/api-logback.xml.prod rename to coin-api-dist/src/main/resources/tomcat/api-logback.prod.xml diff --git a/coin-api-dist/src/main/resources/tomcat/api-logback.xml.test b/coin-api-dist/src/main/resources/tomcat/api-logback.test.xml similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/api-logback.xml.test rename to coin-api-dist/src/main/resources/tomcat/api-logback.test.xml diff --git a/coin-api-dist/src/main/resources/tomcat/api-logback.xml.vm b/coin-api-dist/src/main/resources/tomcat/api-logback.vm.xml similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/api-logback.xml.vm rename to coin-api-dist/src/main/resources/tomcat/api-logback.vm.xml diff --git a/coin-api-dist/src/main/resources/tomcat/coin-api.properties.acc b/coin-api-dist/src/main/resources/tomcat/coin-api.acc.properties similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/coin-api.properties.acc rename to coin-api-dist/src/main/resources/tomcat/coin-api.acc.properties diff --git a/coin-api-dist/src/main/resources/tomcat/coin-api.properties.prod b/coin-api-dist/src/main/resources/tomcat/coin-api.prod.properties similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/coin-api.properties.prod rename to coin-api-dist/src/main/resources/tomcat/coin-api.prod.properties diff --git a/coin-api-dist/src/main/resources/tomcat/coin-api.properties.test b/coin-api-dist/src/main/resources/tomcat/coin-api.test.properties similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/coin-api.properties.test rename to coin-api-dist/src/main/resources/tomcat/coin-api.test.properties diff --git a/coin-api-dist/src/main/resources/tomcat/coin-api.properties.vm b/coin-api-dist/src/main/resources/tomcat/coin-api.vm.properties similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/coin-api.properties.vm rename to coin-api-dist/src/main/resources/tomcat/coin-api.vm.properties From 6448998964357cc932ab1e97f83d6e174043c43a Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Tue, 8 Jul 2014 16:54:54 +0200 Subject: [PATCH 05/21] Moved configuration to Ansible role --- .../ansible-openconext-api/meta/main.yml | 2 +- .../tasks/main/configure.yml | 32 +++++- .../templates/api-ehcache.xml.j2} | 0 .../templates/api-logback.full.xml} | 0 .../templates/api-logback.minimal.xml} | 9 -- .../templates/api-logback.xml.j2 | 0 .../templates/coin-api.properties.j2 | 78 +++++++++++++ .../main/resources/tomcat/api-ehcache.acc.xml | 12 -- .../resources/tomcat/api-ehcache.prod.xml | 12 -- .../resources/tomcat/api-ehcache.test.xml | 12 -- .../resources/tomcat/api-logback.prod.xml | 91 --------------- .../main/resources/tomcat/api-logback.vm.xml | 104 ------------------ .../resources/tomcat/coin-api.acc.properties | 104 ------------------ .../resources/tomcat/coin-api.prod.properties | 104 ------------------ .../resources/tomcat/coin-api.test.properties | 103 ----------------- .../resources/tomcat/coin-api.vm.properties | 104 ------------------ .../src/main/resources/application.properties | 104 ------------------ 17 files changed, 110 insertions(+), 761 deletions(-) rename coin-api-dist/src/main/resources/{tomcat/api-ehcache.vm.xml => ansible-openconext-api/templates/api-ehcache.xml.j2} (100%) rename coin-api-dist/src/main/resources/{tomcat/api-logback.test.xml => ansible-openconext-api/templates/api-logback.full.xml} (100%) rename coin-api-dist/src/main/resources/{tomcat/api-logback.acc.xml => ansible-openconext-api/templates/api-logback.minimal.xml} (93%) create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.xml.j2 create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 delete mode 100644 coin-api-dist/src/main/resources/tomcat/api-ehcache.acc.xml delete mode 100644 coin-api-dist/src/main/resources/tomcat/api-ehcache.prod.xml delete mode 100644 coin-api-dist/src/main/resources/tomcat/api-ehcache.test.xml delete mode 100644 coin-api-dist/src/main/resources/tomcat/api-logback.prod.xml delete mode 100644 coin-api-dist/src/main/resources/tomcat/api-logback.vm.xml delete mode 100644 coin-api-dist/src/main/resources/tomcat/coin-api.acc.properties delete mode 100644 coin-api-dist/src/main/resources/tomcat/coin-api.prod.properties delete mode 100644 coin-api-dist/src/main/resources/tomcat/coin-api.test.properties delete mode 100644 coin-api-dist/src/main/resources/tomcat/coin-api.vm.properties delete mode 100644 coin-api-war/src/main/resources/application.properties diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml index 63d46e5..4fa89d6 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml @@ -9,5 +9,5 @@ galaxy_info: - 6 categories: - web -dependencies: [] +dependencies: [ "ansible-xml" ] version: 4.2.0 \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml index 3e42bcb..dc1387c 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml @@ -1,2 +1,32 @@ --- - - name: \ No newline at end of file + - name: Set logging configuration + template: + src: "api-logback.{{ api_logging_policy }}.xml" + dest: "{{ tomcat_classpath_path }}/api-logback.xml" + + - name: Set caching configuration + template: + src: api-ehcache.xml.j2 + dest: "{{ tomcat_classpath_path }}/api-ehcache.xml" + + - name: Set configuration properties + template: + src: coin-api.properties.j2 + dest: "{{ tomcat_classpath_path }}/coin-api.properties" + + - name: Count the host we're trying to add + xml: + file: "{{ tomcat_conf_path }}/server.xml" + xpath: "/Server/Service[@name='Catalina']/Engine[@name='Standalone']/Host[@name='api.{{ openconext_domain }}']" + count: true + register: ansible_host + + - name: Add Ansible Host + xml: + file: "{{ tomcat_conf_path }}/server.xml" + xpath: "/Server/Service[@name='Catalina']/Engine[@name='Standalone']" + add_children: + - Host: + name: "api.{{ openconext_domain }}" + appBase: "webapps/api.{{ openconext_domain }}" + when: ansible_host.count == 0 \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/api-ehcache.vm.xml b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-ehcache.xml.j2 similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/api-ehcache.vm.xml rename to coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-ehcache.xml.j2 diff --git a/coin-api-dist/src/main/resources/tomcat/api-logback.test.xml b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.full.xml similarity index 100% rename from coin-api-dist/src/main/resources/tomcat/api-logback.test.xml rename to coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.full.xml diff --git a/coin-api-dist/src/main/resources/tomcat/api-logback.acc.xml b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.minimal.xml similarity index 93% rename from coin-api-dist/src/main/resources/tomcat/api-logback.acc.xml rename to coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.minimal.xml index 42ec354..09cda97 100644 --- a/coin-api-dist/src/main/resources/tomcat/api-logback.acc.xml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.minimal.xml @@ -33,15 +33,6 @@ warn - - - - diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.xml.j2 b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.xml.j2 new file mode 100644 index 0000000..e69de29 diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 new file mode 100644 index 0000000..a55dfd1 --- /dev/null +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 @@ -0,0 +1,78 @@ +#################################################################### +## +## The following properties are the responsibility of the owners +## of the machine. The developers do not know the values. +## +#################################################################### + +janus.user={{ api_janus_user }} +janus.secret={{ api_janus_secret }} +janus.uri=https://serviceregistry.{{ openconext_domain }}/simplesaml/module.php/janus/services/rest/ + +coin-api.jdbc.driver=com.mysql.jdbc.Driver +coin-api.jdbc.url=jdbc:mysql://db.{{ openconext_domain }}:3306/api +coin-api.jdbc.user={{ api_db_user }} +coin-api.jdbc.password={{ api_db_password }} + +coin-api.ldap.url=ldap://ldap.{{ openconext_domain }}389 +coin-api.ldap.userDn={{ api_ldap_bind_dn }} +coin-api.ldap.password={{ api_ldap_password }} + +coin-api.engineblock.jdbc.driver=com.mysql.jdbc.Driver +coin-api.engineblock.jdbc.url=jdbc:mysql://db.{{ openconext_domain }}:3306/{{ engine_db_name}} +coin-api.engineblock.jdbc.user={{ engine_db_user }} +coin-api.engineblock.jdbc.password={{ engine_db_password }} + +coin-api.teams.jdbc.driver=com.mysql.jdbc.Driver +coin-api.teams.jdbc.url=jdbc:mysql://db.{{ openconext_domain }}:3306/{{ teams_db_name }} +coin-api.teams.jdbc.user={{ teams_db_user }} +coin-api.teams.jdbc.password={{ teams_db_password }} + +# Email address that recieves error notifications +coin-errormail-to={{ openconext_error_mail }} + +# Callback URL of the OAuth client +coin-api.oauth.callback.url=https://api.{{ openconext_domain }}/v1/test/oauth-callback.shtml + +#################################################################### +## +## The following properties are the responsibility of the developers +## +#################################################################### + +#Choose either mockClientDetailsService or janusClientDetailsService +clientDetailsServiceClass=nl.surfnet.coin.api.service.JanusClientDetailsService + +#For future purposes we might mock them +ldapClientClass=nl.surfnet.coin.ldap.LdapClientImpl +engineblockClass=nl.surfnet.coin.eb.EngineBlockImpl +groupServiceClass=nl.surfnet.coin.api.service.GroupServiceImpl + +#Is the mock API enabled? +mock-api-enabled=false + +#The directory (in the war) where the db migration scrips reside +coin-api.db.migrations.folder=db/migration/mysql + +#Cache manager +cacheManagerClass=org.springframework.cache.ehcache.EhCacheCacheManager + +staticContentBasePath=https://static.{{ openconext_domain }} + +# Default locale for consent screen +coin-api.locale-default=nl + +# SAML properties +entityId=https://api.{{ openconext_domain }}/ +assertionConsumerURI=https://api.{{ openconext_domain }}/v1/assertionConsumer +idpUrl=https://engine.{{ openconext_domain }}/authentication/idp/single-sign-on +idpCertificate={{ engine_idp_cert_string }} +idpEntityId=https://engine.{{ openconext_domain }}/authentication/idp/metadata +spPrivateKey={{ api_sp_key_string }} +spCertificate={{ api_sp_cert_string }} + +#which SAML attribute holds the UUID +saml-uuid-attribute=urn:oid:1.3.6.1.4.1.1076.20.40.40.1 + +# this is part of a regex pattern that should determine whether the group is internal +api.internal.group.pattern=^urn:collab:group:\\w*\\.?surfteams.nl.* \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/api-ehcache.acc.xml b/coin-api-dist/src/main/resources/tomcat/api-ehcache.acc.xml deleted file mode 100644 index b4d261e..0000000 --- a/coin-api-dist/src/main/resources/tomcat/api-ehcache.acc.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/api-ehcache.prod.xml b/coin-api-dist/src/main/resources/tomcat/api-ehcache.prod.xml deleted file mode 100644 index b4d261e..0000000 --- a/coin-api-dist/src/main/resources/tomcat/api-ehcache.prod.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/api-ehcache.test.xml b/coin-api-dist/src/main/resources/tomcat/api-ehcache.test.xml deleted file mode 100644 index b4d261e..0000000 --- a/coin-api-dist/src/main/resources/tomcat/api-ehcache.test.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/api-logback.prod.xml b/coin-api-dist/src/main/resources/tomcat/api-logback.prod.xml deleted file mode 100644 index bd704cc..0000000 --- a/coin-api-dist/src/main/resources/tomcat/api-logback.prod.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - ${CATALINA_BASE}/logs/api.log - - - ${CATALINA_BASE}/logs/api-%d{yyyy-MM-dd}.log.gz - 60 - - - %d{ISO8601} %5p [%t] %logger{40}:%L - %m%n - - - - - - warn - - - - - - - - - ${CATALINA_BASE}/logs/api-fc.log - - - ${CATALINA_BASE}/logs/api-%d{yyyy-MM-dd}.log.gz - 60 - - - %d{ISO8601} %5p [%t] %logger{40}:%L - %m%n - - - - - - - - org.springframework - info - - - org.opensaml - info - - - org.apache - info - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/api-logback.vm.xml b/coin-api-dist/src/main/resources/tomcat/api-logback.vm.xml deleted file mode 100644 index d16af8e..0000000 --- a/coin-api-dist/src/main/resources/tomcat/api-logback.vm.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - ${CATALINA_BASE}/logs/api.log - - - ${CATALINA_BASE}/logs/api-%d{yyyy-MM-dd}.log.gz - 60 - - - %d{ISO8601} %5p [%t] %logger{40}:%L - %m%n - - - - - - info - - - - - org.springframework - warn - - - org.hibernate - warn - - - org.opensaml - warn - - - org.apache - warn - - - hsqldb.db - warn - - - - - ${CATALINA_BASE}/logs/api-fc.log - - - ${CATALINA_BASE}/logs/api-%d{yyyy-MM-dd}.log.gz - 60 - - - %d{ISO8601} %5p [%t] %logger{40}:%L - %m%n - - - - - - - - org.springframework - info - - - org.opensaml - info - - - org.apache - info - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/coin-api.acc.properties b/coin-api-dist/src/main/resources/tomcat/coin-api.acc.properties deleted file mode 100644 index 059c1a0..0000000 --- a/coin-api-dist/src/main/resources/tomcat/coin-api.acc.properties +++ /dev/null @@ -1,104 +0,0 @@ -# -# Copyright 2012 SURFnet bv, The Netherlands -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#################################################################### -## -## The following properties are the responsibility of the owners -## of the machine. The developers do not know the values. -## -#################################################################### - -janus.user=?? -janus.secret=?? -janus.uri=https://serviceregistry.acc.surfconext.nl/simplesaml/module.php/janus/services/rest/ - -coin-api.jdbc.driver=com.mysql.jdbc.Driver -coin-api.jdbc.url=jdbc:mysql://db.acc.surfconext.nl:3306/api -coin-api.jdbc.user=?? -coin-api.jdbc.password=?? - -coin-api.ldap.url=ldap://ldap.acc.surfconext.nl:389 -coin-api.ldap.password=?? -coin-api.ldap.userDn=?? - -coin-api.engineblock.jdbc.driver=com.mysql.jdbc.Driver -coin-api.engineblock.jdbc.password=?? -coin-api.engineblock.jdbc.url=jdbc:mysql://db.acc.surfconext.nl:3306/eb -coin-api.engineblock.jdbc.user=?? - -coin-api.teams.jdbc.driver=com.mysql.jdbc.Driver -coin-api.teams.jdbc.url=jdbc:mysql://db.acc.surfconext.nl:3306/teams -coin-api.teams.jdbc.user=?? -coin-api.teams.jdbc.password=?? - - -# global configuration of database properties, used for all data sources -# in seconds -coin-api.database.idleConnectionTestPeriod=900 -# in seconds -coin-api.database.maxIdleTime=900 - -# SMTP server settings for notifications -coin-mailserver=??? -coin-mailserver-port=25 - -# Email address that recieves error notifications -coin-errormail-to=coin-logs@list.surfnet.nl - -# Callback URL of the OAuth client -coin-api.oauth.callback.url=https://api.acc.surfconext.nl/v1/test/oauth-callback.shtml - -#################################################################### -## -## The following properties are the responsibility of the developers -## -#################################################################### - -#Choose either mockClientDetailsService or janusClientDetailsService -clientDetailsServiceClass=nl.surfnet.coin.api.service.JanusClientDetailsService - -#For future purposes we might mock them -ldapClientClass=nl.surfnet.coin.ldap.LdapClientImpl -engineblockClass=nl.surfnet.coin.eb.EngineBlockImpl -groupServiceClass=nl.surfnet.coin.api.service.GroupServiceImpl - -#Is the mock API enabled? -mock-api-enabled=false - -#The directory (in the war) where the db migration scrips reside -coin-api.db.migrations.folder=db/migration/mysql -#Cache manager -cacheManagerClass=org.springframework.cache.ehcache.EhCacheCacheManager - -staticContentBasePath=https://static.acc.surfconext.nl - -# Default locale for consent screen -coin-api.locale-default=nl - -# SAML properties -entityId=https://api.acc.surfconext.nl/ -assertionConsumerURI=https://api.acc.surfconext.nl/v1/assertionConsumer -idpUrl=https://engine.acc.surfconext.nl/authentication/idp/single-sign-on -idpCertificate=MIICgTCCAeoCCQCbOlrWDdX7FTANBgkqhkiG9w0BAQUFADCBhDELMAkGA1UEBhMCTk8xGDAWBgNVBAgTD0FuZHJlYXMgU29sYmVyZzEMMAoGA1UEBxMDRm9vMRAwDgYDVQQKEwdVTklORVRUMRgwFgYDVQQDEw9mZWlkZS5lcmxhbmcubm8xITAfBgkqhkiG9w0BCQEWEmFuZHJlYXNAdW5pbmV0dC5ubzAeFw0wNzA2MTUxMjAxMzVaFw0wNzA4MTQxMjAxMzVaMIGEMQswCQYDVQQGEwJOTzEYMBYGA1UECBMPQW5kcmVhcyBTb2xiZXJnMQwwCgYDVQQHEwNGb28xEDAOBgNVBAoTB1VOSU5FVFQxGDAWBgNVBAMTD2ZlaWRlLmVybGFuZy5ubzEhMB8GCSqGSIb3DQEJARYSYW5kcmVhc0B1bmluZXR0Lm5vMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDivbhR7P516x/S3BqKxupQe0LONoliupiBOesCO3SHbDrl3+q9IbfnfmE04rNuMcPsIxB161TdDpIesLCn7c8aPHISKOtPlAeTZSnb8QAu7aRjZq3+PbrP5uW3TcfCGPtKTytHOge/OlJbo078dVhXQ14d1EDwXJW1rRXuUt4C8QIDAQABMA0GCSqGSIb3DQEBBQUAA4GBACDVfp86HObqY+e8BUoWQ9+VMQx1ASDohBjwOsg2WykUqRXF+dLfcUH9dWR63CtZIKFDbStNomPnQz7nbK+onygwBspVEbnHuUihZq3ZUdmumQqCw4Uvs/1Uvq3orOo/WJVhTyvLgFVK2QarQ4/67OZfHd7R+POBXhophSMv1ZOo -idpEntityId=https://engine.acc.surfconext.nl/authentication/idp/metadata -spPrivateKey=?? -spCertificate=?? - -#which SAML attribute holds the UUID -saml-uuid-attribute=urn:oid:1.3.6.1.4.1.1076.20.40.40.1 - -# this is part of a regex pattern that should determine whether the group is internal -api.internal.group.pattern=^urn:collab:group:\\w*\\.?surfteams.nl.* \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/coin-api.prod.properties b/coin-api-dist/src/main/resources/tomcat/coin-api.prod.properties deleted file mode 100644 index 99c44f0..0000000 --- a/coin-api-dist/src/main/resources/tomcat/coin-api.prod.properties +++ /dev/null @@ -1,104 +0,0 @@ -# -# Copyright 2012 SURFnet bv, The Netherlands -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#################################################################### -## -## The following properties are the responsibility of the owners -## of the machine. The developers do not know the values. -## -#################################################################### - -janus.user=?? -janus.secret=?? -janus.uri=https://serviceregistry.surfconext.nl/simplesaml/module.php/janus/services/rest/ - -coin-api.jdbc.driver=com.mysql.jdbc.Driver -coin-api.jdbc.url=jdbc:mysql://db.surfconext.nl:3306/api -coin-api.jdbc.user=?? -coin-api.jdbc.password=?? - -coin-api.ldap.url=ldap://ldap.surfconext.nl:389 -coin-api.ldap.password=?? -coin-api.ldap.userDn=?? - -coin-api.engineblock.jdbc.driver=com.mysql.jdbc.Driver -coin-api.engineblock.jdbc.password=?? -coin-api.engineblock.jdbc.url=jdbc:mysql://db.surfconext.nl:3306/eb -coin-api.engineblock.jdbc.user=?? - -coin-api.teams.jdbc.driver=com.mysql.jdbc.Driver -coin-api.teams.jdbc.url=jdbc:mysql://db.surfconext.nl:3306/teams -coin-api.teams.jdbc.user=?? -coin-api.teams.jdbc.password=?? - -# global configuration of database properties, used for all data sources -# in seconds -coin-api.database.idleConnectionTestPeriod=900 -# in seconds -coin-api.database.maxIdleTime=900 - -# SMTP server settings for notifications -coin-mailserver=??? -coin-mailserver-port=25 - -# Email address that recieves error notifications -coin-errormail-to=coin-logs@list.surfnet.nl - -# Callback URL of the OAuth client -coin-api.oauth.callback.url=https://api.surfconext.nl/v1/test/oauth-callback.shtml - -#################################################################### -## -## The following properties are the responsibility of the developers -## -#################################################################### - -#Choose either mockClientDetailsService or janusClientDetailsService -clientDetailsServiceClass=nl.surfnet.coin.api.service.JanusClientDetailsService - -#For future purposes we might mock them -ldapClientClass=nl.surfnet.coin.ldap.LdapClientImpl -engineblockClass=nl.surfnet.coin.eb.EngineBlockImpl -groupServiceClass=nl.surfnet.coin.api.service.GroupServiceImpl - -#Is the mock API enabled? -mock-api-enabled=false - -#The directory (in the war) where the db migration scrips reside -coin-api.db.migrations.folder=db/migration/mysql - -#Cache manager -cacheManagerClass=org.springframework.cache.ehcache.EhCacheCacheManager - -staticContentBasePath=https://static.surfconext.nl - -# Default locale for consent screen -coin-api.locale-default=nl - -# SAML properties -entityId=https://api.surfconext.nl/ -assertionConsumerURI=https://api.surfconext.nl/v1/assertionConsumer -idpUrl=https://engine.surfconext.nl/authentication/idp/single-sign-on -idpCertificate=MIIDyzCCArOgAwIBAgIJAMzixtXMUH1NMA0GCSqGSIb3DQEBBQUAMHwxCzAJBgNVBAYTAk5MMRAwDgYDVQQIDAdVdHJlY2h0MRAwDgYDVQQHDAdVdHJlY2h0MRUwEwYDVQQKDAxTVVJGbmV0IEIuVi4xEzARBgNVBAsMClNVUkZjb25leHQxHTAbBgNVBAMMFGVuZ2luZS5zdXJmY29uZXh0Lm5sMB4XDTExMDEyNDEwMTg1N1oXDTIxMDEyMzEwMTg1N1owfDELMAkGA1UEBhMCTkwxEDAOBgNVBAgMB1V0cmVjaHQxEDAOBgNVBAcMB1V0cmVjaHQxFTATBgNVBAoMDFNVUkZuZXQgQi5WLjETMBEGA1UECwwKU1VSRmNvbmV4dDEdMBsGA1UEAwwUZW5naW5lLnN1cmZjb25leHQubmwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDMJ6v+f3owS3KR5IXSil+3XFwGvCVeYx3jDOFKAnwvXlDpTu+t730b8/spHtlopyJVAlb6qBIPN7R4TGTLqiu0zebYsYx/PtqCk5cbu9qs3h+p2BBoTXVwXA/ZYi0tqtxp04hcNrRj1TAgLyC0S+KASTF+zzccAcjTBid5EMioo+YllgSEobWJ4X33XVRqNrikAPDsNmDrdKUi257JSO2xhVIG5lbtmDaL5ORCD56oRmVdp7VQTEQ3Yass8J5Rn+Ub6WmRBYeG+KzFBvtyBput2o0/gvtJn9L+NWeDB0LyUPaUYG/X4GF14FcmFQfz7I5jBCNHtPcLJbPYbZKQNhz/AgMBAAGjUDBOMB0GA1UdDgQWBBS9QqP8gtMM6nm4oYzNbgqhEDP1aDAfBgNVHSMEGDAWgBS9QqP8gtMM6nm4oYzNbgqhEDP1aDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQBH2qyYwLwesIOxUTj+NJ0VXRBDH8VecNLiUUs9Np4x8A0pxLvlNnv5TdJAruEg1LSVmAqqPUdAB2m7CKDeUVM9cwOB7vqelV2GNgOfevXi+DZRMffyyE8qyIcnTqvDOgcR8qGTPSVT+SIsOkV9bYrjltrbnal7cJermsA8SC5w/pjLaOHI1xIZHquZzymWoN3Zfz2CQg2r5o+AURYd74GrHhHqVa9VrdWtcimB+vTQQihoLt8YciehpJjOMpx2D66eFfpC8ix31RRdjAVIo1y33h1yU3gEHePDbOthZE+lpXi2WJqO85H85LqJOtgn2WPI3P2Tx32Cq1WXCYkxLaPI -idpEntityId=https://engine.surfconext.nl/authentication/idp/metadata -spPrivateKey=?? -spCertificate=?? - -#which SAML attribute holds the UUID -saml-uuid-attribute=urn:oid:1.3.6.1.4.1.1076.20.40.40.1 - -# this is part of a regex pattern that should determine whether the group is internal -api.internal.group.pattern=^urn:collab:group:\\w*\\.?surfteams.nl.* \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/coin-api.test.properties b/coin-api-dist/src/main/resources/tomcat/coin-api.test.properties deleted file mode 100644 index 1f5014f..0000000 --- a/coin-api-dist/src/main/resources/tomcat/coin-api.test.properties +++ /dev/null @@ -1,103 +0,0 @@ -# -# Copyright 2012 SURFnet bv, The Netherlands -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#################################################################### -## -## The following properties are the responsibility of the owners -## of the machine. The developers do not know the values. -## -#################################################################### - -janus.user=?? -janus.secret=?? -janus.uri=https://serviceregistry.test.surfconext.nl/simplesaml/module.php/janus/services/rest/ - -coin-api.jdbc.driver=com.mysql.jdbc.Driver -coin-api.jdbc.url=jdbc:mysql://db.test.surfconext.nl:3306/api -coin-api.jdbc.user=?? -coin-api.jdbc.password=?? - -coin-api.ldap.url=ldap://ldap.test.surfconext.nl:389 -coin-api.ldap.password=?? -coin-api.ldap.userDn=?? - -coin-api.engineblock.jdbc.driver=com.mysql.jdbc.Driver -coin-api.engineblock.jdbc.password=?? -coin-api.engineblock.jdbc.url=jdbc:mysql://db.test.surfconext.nl:3306/eb -coin-api.engineblock.jdbc.user=?? - -coin-api.teams.jdbc.driver=com.mysql.jdbc.Driver -coin-api.teams.jdbc.url=jdbc:mysql://db.test.surfconext.nl:3306/teams -coin-api.teams.jdbc.user=?? -coin-api.teams.jdbc.password=?? - -# global configuration of database properties, used for all data sources -# in seconds -coin-api.database.idleConnectionTestPeriod=900 -# in seconds -coin-api.database.maxIdleTime=900 - -# SMTP server settings for notifications -coin-mailserver=s01.dev.coin.surf.net -coin-mailserver-port=25 - -# Email address that recieves error notifications -coin-errormail-to= - -# Callback URL of the OAuth client -coin-api.oauth.callback.url=https://api.test.surfconext.nl/v1/test/oauth-callback.shtml - -#################################################################### -## -## The following properties are the responsibility of the developers -## -#################################################################### - -#Choose either mockClientDetailsService or janusClientDetailsService -clientDetailsServiceClass=nl.surfnet.coin.api.service.JanusClientDetailsService - -#For future purposes we might mock them -ldapClientClass=nl.surfnet.coin.ldap.LdapClientImpl -engineblockClass=nl.surfnet.coin.eb.EngineBlockImpl -groupServiceClass=nl.surfnet.coin.api.service.GroupServiceImpl - -#Is the mock API enabled? -mock-api-enabled=true - -#The directory (in the war) where the db migration scrips reside -coin-api.db.migrations.folder=db/migration/mysql -#Cache manager -cacheManagerClass=nl.surfnet.coin.shared.cache.ConextNoOpCacheManager - -staticContentBasePath=https://static.test.surfconext.nl - -# Default locale for consent screen -coin-api.locale-default=nl - -# SAML properties -entityId=https://api.test.surfconext.nl/ -assertionConsumerURI=https://api.test.surfconext.nl/v1/assertionConsumer -idpUrl=https://engine.test.surfconext.nl/authentication/idp/single-sign-on -idpCertificate=MIID/jCCAuYCCQCs7BsDR2N8tjANBgkqhkiG9w0BAQUFADCBwDELMAkGA1UEBhMCTkwxEDAOBgNVBAgTB1V0cmVjaHQxEDAOBgNVBAcTB1V0cmVjaHQxJTAjBgNVBAoTHFNVUkZuZXQgQlYgLSBUaGUgTmV0aGVybGFuZHMxHzAdBgNVBAsTFkNvbGxhYm9yYXRpb24gU2VydmljZXMxGDAWBgNVBAMTD1NVUkZjb25leHQtdGVzdDErMCkGCSqGSIb3DQEJARYcc3VyZmNvbmV4dC1iZWhlZXJAc3VyZm5ldC5ubDAeFw0xMTA2MjcxNTM0NDFaFw0yMTA2MjQxNTM0NDFaMIHAMQswCQYDVQQGEwJOTDEQMA4GA1UECBMHVXRyZWNodDEQMA4GA1UEBxMHVXRyZWNodDElMCMGA1UEChMcU1VSRm5ldCBCViAtIFRoZSBOZXRoZXJsYW5kczEfMB0GA1UECxMWQ29sbGFib3JhdGlvbiBTZXJ2aWNlczEYMBYGA1UEAxMPU1VSRmNvbmV4dC10ZXN0MSswKQYJKoZIhvcNAQkBFhxzdXJmY29uZXh0LWJlaGVlckBzdXJmbmV0Lm5sMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA27T+ALNpoU9PAvRYj2orOXaEVcy1fHSU/rZEakpgNzOFIEL9UB6BvtWdRbO5FT84yN+x2Qzpu6WLpwU7JFb36aRwPmBmabxUx95DhNQNFGA3ZkHu6DOA81GiG0Ll9p9S/EV2fmHGJdJjh5BP1v0/y7bJ/2JmvdzH+cFhEhFk0Ex9HNbC0Hmy9Sn8EXbg3RQO5/2e51wSv4uGALkyGM6lrOG/R1GenoAI8Ys7LNxj3NGkhKRUtpwHoIViWU5cOy26kG9VOG9bAVk51l0LNayMqyieX9UrCp1akQuP3Ir/ogtbKo2zg63Ho1cc43tHHdLZTHp2TWRRGEgnskvGZLddzwIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQB8eUq/0ArBGnPZHNn2o2ip+3i0U4r0swKXjuYL/o2VXqo3eI9j/bCvWw5NOLQVbk/Whc6dSeYIt1oVW/ND4iQZ7LHZr9814IOE3KLGIMeZgjPsXH15o9W4aLC0npPYilw96dfIAq49tOn44jhsRHrdR8z/NFPXE09ehAEb7fOIrxdlf7YDGYx+gXLEnsJo75E6LwCr/y/MBd13DDJNc1HUViiEz+Mkfo4FEKe/5HgEvDy2XjuE1juDCqJ/07pBPHBd0DtM7uaxGw+Zt/Fc4uE0NvtlCZqShFUvMmqHL5oENOlfTmBSWJMbBAGs2O/JQirG2aYcULqXYoCGIPUF49Z6 -idpEntityId=https://engine.test.surfconext.nl/authentication/idp/metadata -spPrivateKey=?? -spCertificate=MIIElDCCA3ygAwIBAgIRALiiKpfyWJ/KD9lnPViI/JowDQYJKoZIhvcNAQEFBQAwNjELMAkGA1UEBhMCTkwxDzANBgNVBAoTBlRFUkVOQTEWMBQGA1UEAxMNVEVSRU5BIFNTTCBDQTAeFw0xMTA0MTQwMDAwMDBaFw0xNDA0MTMyMzU5NTlaMFYxCzAJBgNVBAYTAk5MMRUwEwYDVQQKEwxTVVJGbmV0IEIuVi4xETAPBgNVBAsTCFNlcnZpY2VzMR0wGwYDVQQDFBQqLnRlc3Quc3VyZmNvbmV4dC5ubDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALW9kKFjpT6SsdYr2nNfG41oBbGMuCP/EdzCCb0aGp/xmO5wJXbxQFeNOJSmynDyMAgDMMWz00kDWuv1IDiMsv5Yjr5wkpij0n/9PhKSC53kmCqFRYOvE0FOSQJdPeSJ9VPx8DrhAhKjbey+Y03Rg885yDT+Gfwbi4S3CjV75Q7bGl0YIdOeNsuDug7tNZZQr+0SaOEbr5TcXjsy2Lku3+aVo72XXa5pSj76qXVaKk4d2WR0WK4/FhH+1ZyOHwZrAL2WhXoyaVl58fsEoVxI/S+3MCoaAOJFQTkasDUeFHXK0Apf+Goq6+iddZTTJ2KomgspcbqG5v4RyU/brCQmdXMCAwEAAaOCAXswggF3MB8GA1UdIwQYMBaAFAy9k2gM896ro0lrKzdXR+qQ47ntMB0GA1UdDgQWBBQTOubwIqsyvkMvOng9SgBpPJfJAzAOBgNVHQ8BAf8EBAMCBaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwGAYDVR0gBBEwDzANBgsrBgEEAbIxAQICHTA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLnRjcy50ZXJlbmEub3JnL1RFUkVOQVNTTENBLmNybDBtBggrBgEFBQcBAQRhMF8wNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQudGNzLnRlcmVuYS5vcmcvVEVSRU5BU1NMQ0EuY3J0MCYGCCsGAQUFBzABhhpodHRwOi8vb2NzcC50Y3MudGVyZW5hLm9yZzAzBgNVHREELDAqghQqLnRlc3Quc3VyZmNvbmV4dC5ubIISdGVzdC5zdXJmY29uZXh0Lm5sMA0GCSqGSIb3DQEBBQUAA4IBAQA9gHPPlWPoMZVWegfnEgQmA8D3ul39ylDpjG1Nm9+stNWQ67roRfiD2rpx3EGRd+op3S8/lQGuxPrjkv21okpo53ZjeDd4+Wp8dhN9E+pDBBdk6YXSmMJ/CzT9mhs9Ue8AgEQYVY1ztoS3kVW7YEVLMUczTABN97at7mgxCtTHKKHSMdYRGZKhaZ9fC4x10YRX1GLfsB5AI0/HXDtVKRkhzaLWBsAmjAfw0v0bZ7rNKi+vNeOKYPjW+xC3XQ5DTWTgR4ox8PKkAYgkl0+t/hr5KjEgvrmITwtpSUyiNiro2ZqigxzyC23OzNoZWsO/29Phck1Vd5kAmCsh0FMjfLo - -#which SAML attribute holds the UUID -saml-uuid-attribute=urn:oid:1.3.6.1.4.1.1076.20.40.40.1 - -# this is part of a regex pattern that should determine whether the group is internal -api.internal.group.pattern=^urn:collab:group:\\w*\\.?surfteams.nl.* \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/tomcat/coin-api.vm.properties b/coin-api-dist/src/main/resources/tomcat/coin-api.vm.properties deleted file mode 100644 index af9aab4..0000000 --- a/coin-api-dist/src/main/resources/tomcat/coin-api.vm.properties +++ /dev/null @@ -1,104 +0,0 @@ -# -# Copyright 2012 SURFnet bv, The Netherlands -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#################################################################### -## -## The following properties are the responsibility of the owners -## of the machine. The developers do not know the values. -## -#################################################################### - -janus.uri=https://serviceregistry._OPENCONEXT_DOMAIN_/simplesaml/module.php/janus/services/rest/ -janus.user=__OC__API_JANUSAPI_USER__ -janus.secret=__OC__API_JANUSAPI_PASS__ - -coin-api.jdbc.driver=com.mysql.jdbc.Driver -coin-api.jdbc.url=jdbc:mysql://localhost:3306/api -coin-api.jdbc.user=__OC__API_DB_USER___ -coin-api.jdbc.password=__OC__API_DB_PASS__ - -coin-api.ldap.url=ldap://localhost:389 -coin-api.ldap.password=__OC__LDAP_PASS__ -coin-api.ldap.userDn=__OC__LDAP_USER__ - -coin-api.engineblock.jdbc.driver=com.mysql.jdbc.Driver -coin-api.engineblock.jdbc.url=jdbc:mysql://localhost:3306/engineblock -coin-api.engineblock.jdbc.password=__OC__ENGINE_DB_PASS__ -coin-api.engineblock.jdbc.user=__OC__ENGINE_DB_USER__ - -coin-api.teams.jdbc.driver=com.mysql.jdbc.Driver -coin-api.teams.jdbc.url=jdbc:mysql://localhost:3306/teams -coin-api.teams.jdbc.user=__OC__TEAMS_DB_USER__ -coin-api.teams.jdbc.password=__OC__TEAMS_DB_PASS__ - -# global configuration of database properties, used for all data sources -# in seconds -coin-api.database.idleConnectionTestPeriod=900 -# in seconds -coin-api.database.maxIdleTime=900 - -# SMTP server settings for notifications -coin-mailserver=localhost -coin-mailserver-port=25 - -# Email address that recieves error notifications -coin-errormail-to= - -# Callback URL of the OAuth client -coin-api.oauth.callback.url=https://api._OPENCONEXT_DOMAIN_/v1/test/oauth-callback.shtml - -#################################################################### -## -## The following properties are the responsibility of the developers -## -#################################################################### - -#Choose either mockClientDetailsService or janusClientDetailsService -clientDetailsServiceClass=nl.surfnet.coin.api.service.JanusClientDetailsService - -#For future purposes we might mock them -ldapClientClass=nl.surfnet.coin.ldap.LdapClientImpl -engineblockClass=nl.surfnet.coin.eb.EngineBlockImpl -groupServiceClass=nl.surfnet.coin.api.service.GroupServiceImpl - -#Is the mock API enabled? -mock-api-enabled=true - -#The directory (in the war) where the db migration scrips reside -coin-api.db.migrations.folder=db/migration/mysql - -#Cache manager -cacheManagerClass=nl.surfnet.coin.shared.cache.ConextNoOpCacheManager - -staticContentBasePath=https://static._OPENCONEXT_DOMAIN_ - -# Default locale for consent screen -coin-api.locale-default=nl - -# SAML properties -entityId=https://api._OPENCONEXT_DOMAIN_/ -assertionConsumerURI=https://api._OPENCONEXT_DOMAIN_/v1/assertionConsumer -idpUrl=https://engine._OPENCONEXT_DOMAIN_/authentication/idp/single-sign-on -idpCertificate=?? -idpEntityId=https://engine._OPENCONEXT_DOMAIN_/authentication/idp/metadata -spPrivateKey=?? -spCertificate=?? - -#which SAML attribute holds the UUID -saml-uuid-attribute=urn:oid:1.3.6.1.4.1.1076.20.40.40.1 - -# this is part of a regex pattern that should determine whether the group is internal -api.internal.group.pattern=^urn:collab:group:\\w*\\.?_OPENCONEXT_DOMAIN_.* diff --git a/coin-api-war/src/main/resources/application.properties b/coin-api-war/src/main/resources/application.properties deleted file mode 100644 index 99c44f0..0000000 --- a/coin-api-war/src/main/resources/application.properties +++ /dev/null @@ -1,104 +0,0 @@ -# -# Copyright 2012 SURFnet bv, The Netherlands -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#################################################################### -## -## The following properties are the responsibility of the owners -## of the machine. The developers do not know the values. -## -#################################################################### - -janus.user=?? -janus.secret=?? -janus.uri=https://serviceregistry.surfconext.nl/simplesaml/module.php/janus/services/rest/ - -coin-api.jdbc.driver=com.mysql.jdbc.Driver -coin-api.jdbc.url=jdbc:mysql://db.surfconext.nl:3306/api -coin-api.jdbc.user=?? -coin-api.jdbc.password=?? - -coin-api.ldap.url=ldap://ldap.surfconext.nl:389 -coin-api.ldap.password=?? -coin-api.ldap.userDn=?? - -coin-api.engineblock.jdbc.driver=com.mysql.jdbc.Driver -coin-api.engineblock.jdbc.password=?? -coin-api.engineblock.jdbc.url=jdbc:mysql://db.surfconext.nl:3306/eb -coin-api.engineblock.jdbc.user=?? - -coin-api.teams.jdbc.driver=com.mysql.jdbc.Driver -coin-api.teams.jdbc.url=jdbc:mysql://db.surfconext.nl:3306/teams -coin-api.teams.jdbc.user=?? -coin-api.teams.jdbc.password=?? - -# global configuration of database properties, used for all data sources -# in seconds -coin-api.database.idleConnectionTestPeriod=900 -# in seconds -coin-api.database.maxIdleTime=900 - -# SMTP server settings for notifications -coin-mailserver=??? -coin-mailserver-port=25 - -# Email address that recieves error notifications -coin-errormail-to=coin-logs@list.surfnet.nl - -# Callback URL of the OAuth client -coin-api.oauth.callback.url=https://api.surfconext.nl/v1/test/oauth-callback.shtml - -#################################################################### -## -## The following properties are the responsibility of the developers -## -#################################################################### - -#Choose either mockClientDetailsService or janusClientDetailsService -clientDetailsServiceClass=nl.surfnet.coin.api.service.JanusClientDetailsService - -#For future purposes we might mock them -ldapClientClass=nl.surfnet.coin.ldap.LdapClientImpl -engineblockClass=nl.surfnet.coin.eb.EngineBlockImpl -groupServiceClass=nl.surfnet.coin.api.service.GroupServiceImpl - -#Is the mock API enabled? -mock-api-enabled=false - -#The directory (in the war) where the db migration scrips reside -coin-api.db.migrations.folder=db/migration/mysql - -#Cache manager -cacheManagerClass=org.springframework.cache.ehcache.EhCacheCacheManager - -staticContentBasePath=https://static.surfconext.nl - -# Default locale for consent screen -coin-api.locale-default=nl - -# SAML properties -entityId=https://api.surfconext.nl/ -assertionConsumerURI=https://api.surfconext.nl/v1/assertionConsumer -idpUrl=https://engine.surfconext.nl/authentication/idp/single-sign-on -idpCertificate=MIIDyzCCArOgAwIBAgIJAMzixtXMUH1NMA0GCSqGSIb3DQEBBQUAMHwxCzAJBgNVBAYTAk5MMRAwDgYDVQQIDAdVdHJlY2h0MRAwDgYDVQQHDAdVdHJlY2h0MRUwEwYDVQQKDAxTVVJGbmV0IEIuVi4xEzARBgNVBAsMClNVUkZjb25leHQxHTAbBgNVBAMMFGVuZ2luZS5zdXJmY29uZXh0Lm5sMB4XDTExMDEyNDEwMTg1N1oXDTIxMDEyMzEwMTg1N1owfDELMAkGA1UEBhMCTkwxEDAOBgNVBAgMB1V0cmVjaHQxEDAOBgNVBAcMB1V0cmVjaHQxFTATBgNVBAoMDFNVUkZuZXQgQi5WLjETMBEGA1UECwwKU1VSRmNvbmV4dDEdMBsGA1UEAwwUZW5naW5lLnN1cmZjb25leHQubmwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDMJ6v+f3owS3KR5IXSil+3XFwGvCVeYx3jDOFKAnwvXlDpTu+t730b8/spHtlopyJVAlb6qBIPN7R4TGTLqiu0zebYsYx/PtqCk5cbu9qs3h+p2BBoTXVwXA/ZYi0tqtxp04hcNrRj1TAgLyC0S+KASTF+zzccAcjTBid5EMioo+YllgSEobWJ4X33XVRqNrikAPDsNmDrdKUi257JSO2xhVIG5lbtmDaL5ORCD56oRmVdp7VQTEQ3Yass8J5Rn+Ub6WmRBYeG+KzFBvtyBput2o0/gvtJn9L+NWeDB0LyUPaUYG/X4GF14FcmFQfz7I5jBCNHtPcLJbPYbZKQNhz/AgMBAAGjUDBOMB0GA1UdDgQWBBS9QqP8gtMM6nm4oYzNbgqhEDP1aDAfBgNVHSMEGDAWgBS9QqP8gtMM6nm4oYzNbgqhEDP1aDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQBH2qyYwLwesIOxUTj+NJ0VXRBDH8VecNLiUUs9Np4x8A0pxLvlNnv5TdJAruEg1LSVmAqqPUdAB2m7CKDeUVM9cwOB7vqelV2GNgOfevXi+DZRMffyyE8qyIcnTqvDOgcR8qGTPSVT+SIsOkV9bYrjltrbnal7cJermsA8SC5w/pjLaOHI1xIZHquZzymWoN3Zfz2CQg2r5o+AURYd74GrHhHqVa9VrdWtcimB+vTQQihoLt8YciehpJjOMpx2D66eFfpC8ix31RRdjAVIo1y33h1yU3gEHePDbOthZE+lpXi2WJqO85H85LqJOtgn2WPI3P2Tx32Cq1WXCYkxLaPI -idpEntityId=https://engine.surfconext.nl/authentication/idp/metadata -spPrivateKey=?? -spCertificate=?? - -#which SAML attribute holds the UUID -saml-uuid-attribute=urn:oid:1.3.6.1.4.1.1076.20.40.40.1 - -# this is part of a regex pattern that should determine whether the group is internal -api.internal.group.pattern=^urn:collab:group:\\w*\\.?surfteams.nl.* \ No newline at end of file From 80823f25d925f5f0ab3f7920f489d012b15edf1d Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Tue, 8 Jul 2014 17:22:19 +0200 Subject: [PATCH 06/21] Implemented Ansible Activation of API --- .../ansible-openconext-api/tasks/main.yml | 2 +- .../tasks/main/activate.yml | 11 ++++++ .../templates/api.conf.j2 | 38 +++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml create mode 100644 coin-api-dist/src/main/resources/ansible-openconext-api/templates/api.conf.j2 diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml index 9f26e2a..97aa33c 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml @@ -6,4 +6,4 @@ include: main/configure.yml - name: Activate API - service: name=tomcat6 state=restarted \ No newline at end of file + include: main/activate.yml \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml new file mode 100644 index 0000000..cf43e02 --- /dev/null +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml @@ -0,0 +1,11 @@ +--- + - name: Enable Apache proxy + template: + src: api.conf.j2 + dest: "/etc/httpd/conf.d/api.conf" + + - name: Restart Apache + service: name=httpd state=restarted + + - name: Restart Tomcat + service: name=tomcat6 state=restarted \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api.conf.j2 b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api.conf.j2 new file mode 100644 index 0000000..4ac183c --- /dev/null +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api.conf.j2 @@ -0,0 +1,38 @@ + + # General setup for the virtual host, inherited from global configuration + DocumentRoot "/var/www/html/default" + ServerName api.{{ openconext_domain }}:443 + + # Use separate log files for the SSL virtual host; note that LogLevel + # is not inherited from httpd.conf. + ErrorLog logs/api_ssl_error_log + TransferLog logs/api_ssl_access_log + LogLevel warn + + SSLEngine on + SSLProtocol -ALL +SSLv3 +TLSv1 + SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:!RC4-MD5:RC4+RSA:+HIGH:+MEDIU + SSLCertificateFile /etc/httpd/keys/openconext.pem + SSLCertificateKeyFile /etc/httpd/keys/openconext.key + SSLCACertificateFile /etc/httpd/keys/openconext_ca.pem + + RewriteEngine On + RewriteRule ^/$ /v1/$1 [L,R=permanent] + + + SSLOptions +StdEnvVars + + + SetEnvIf User-Agent ".*MSIE.*" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + + CustomLog logs/ssl_request_log \ + "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" + + + # Proxy requests through to Tomcat using AJP + + ProxyPass / ajp://localhost:8009/ + + From 404f6578aee134356b2a3bf038cf88f45a5fbd52 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Tue, 8 Jul 2014 17:22:40 +0200 Subject: [PATCH 07/21] Refactored names of Ansible adding of host to server.xml --- .../resources/ansible-openconext-api/tasks/main/configure.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml index dc1387c..804aed9 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml @@ -14,14 +14,14 @@ src: coin-api.properties.j2 dest: "{{ tomcat_classpath_path }}/coin-api.properties" - - name: Count the host we're trying to add + - name: Detect if we're already in the server.xml xml: file: "{{ tomcat_conf_path }}/server.xml" xpath: "/Server/Service[@name='Catalina']/Engine[@name='Standalone']/Host[@name='api.{{ openconext_domain }}']" count: true register: ansible_host - - name: Add Ansible Host + - name: If not then add a Host element to server.xml xml: file: "{{ tomcat_conf_path }}/server.xml" xpath: "/Server/Service[@name='Catalina']/Engine[@name='Standalone']" From 152c0cea72ffc226951c3c331fbf8139065f7147 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Thu, 10 Jul 2014 08:38:31 +0200 Subject: [PATCH 08/21] Ansible role fix: Use serviceregistry_url instead of divining it yourself --- .../ansible-openconext-api/templates/coin-api.properties.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 index a55dfd1..6c1023c 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 @@ -7,7 +7,7 @@ janus.user={{ api_janus_user }} janus.secret={{ api_janus_secret }} -janus.uri=https://serviceregistry.{{ openconext_domain }}/simplesaml/module.php/janus/services/rest/ +janus.uri={{ serviceregistry_url }} coin-api.jdbc.driver=com.mysql.jdbc.Driver coin-api.jdbc.url=jdbc:mysql://db.{{ openconext_domain }}:3306/api From 94a02518064744220ef0f6747cdabf3441b9acf7 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Thu, 10 Jul 2014 09:49:14 +0200 Subject: [PATCH 09/21] Moved activation from role to environment --- .../ansible-openconext-api/tasks/main/activate.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml index cf43e02..3631a46 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml @@ -1,11 +1,3 @@ --- - - name: Enable Apache proxy - template: - src: api.conf.j2 - dest: "/etc/httpd/conf.d/api.conf" - - - name: Restart Apache - service: name=httpd state=restarted - - name: Restart Tomcat service: name=tomcat6 state=restarted \ No newline at end of file From e90b9374ee092e5992fe9ee6d0eec945049242cd Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Thu, 10 Jul 2014 10:36:40 +0200 Subject: [PATCH 10/21] Ansible Role bugfix: Shhhhht Maven, be quiet now --- .../resources/ansible-openconext-api/tasks/main/install-src.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml index a783406..c308905 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml @@ -7,7 +7,7 @@ version: "{{ api_version }}" - name: SRC - Running Maven install - command: mvn clean install -DskipTests + command: mvn -q clean install -DskipTests args: chdir: "{{ api_release_dir }}" From 622e102b467d170499c301d01a78acb8c1053062 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Thu, 10 Jul 2014 10:37:17 +0200 Subject: [PATCH 11/21] Ansible role bugfix: {{ version }} should be {{ api_version }} --- .../resources/ansible-openconext-api/tasks/main/install-src.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml index c308905..6e20026 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml @@ -12,4 +12,4 @@ chdir: "{{ api_release_dir }}" - name: SRC - Copy build to build directory - copy: src="coin-api-dist/target/coin-api-dist-{{ version }}-bin.tar.gz" dest={{ api_build_path }} \ No newline at end of file + copy: src="coin-api-dist/target/coin-api-dist-{{ api_version }}-bin.tar.gz" dest={{ api_build_path }} \ No newline at end of file From 71768064bc0ab62483ea84bbc053892f7cb89b99 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Fri, 11 Jul 2014 17:23:28 +0200 Subject: [PATCH 12/21] Bugfixes to Ansible role after testing --- .../tasks/main/configure.yml | 6 ++--- .../tasks/main/install-src.yml | 27 ++++++++++++++++++- .../tasks/main/install.yml | 9 +++++-- .../templates/coin-api.properties.j2 | 2 +- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml index 804aed9..7e5fbd7 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml @@ -1,17 +1,17 @@ --- - name: Set logging configuration template: - src: "api-logback.{{ api_logging_policy }}.xml" + src: "../../templates/api-logback.{{ api_logging_policy }}.xml" dest: "{{ tomcat_classpath_path }}/api-logback.xml" - name: Set caching configuration template: - src: api-ehcache.xml.j2 + src: ../../templates/api-ehcache.xml.j2 dest: "{{ tomcat_classpath_path }}/api-ehcache.xml" - name: Set configuration properties template: - src: coin-api.properties.j2 + src: ../../templates/coin-api.properties.j2 dest: "{{ tomcat_classpath_path }}/coin-api.properties" - name: Detect if we're already in the server.xml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml index 6e20026..6a693a4 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml @@ -1,4 +1,9 @@ --- + - name: SRC - Remove repo + file: + path: "{{ api_release_dir }}" + state: absent + - name: SRC - Install Git repo git: accept_hostkey: yes @@ -6,10 +11,30 @@ dest: "{{ api_release_dir }}" version: "{{ api_version }}" + - name: Set the version in the parent project) (may not have been set properly for branches) + xml: + file: "{{ api_release_dir }}/pom.xml" + xpath: /*[name()='project']/*[name()='version'] + value: "{{ api_version_dir }}" + + - name: Set the version (in all parent projects) (may not have been set properly for branches) + xml: + file: "{{ item }}" + xpath: /*[name()='project']/*[name()='parent']/*[name()='version'] + value: "{{ api_version_dir }}" + with_items: + - "{{ api_release_dir }}/coin-api-client/pom.xml" + - "{{ api_release_dir }}/coin-api-dist/pom.xml" + - "{{ api_release_dir }}/coin-api-external-groups/pom.xml" + - "{{ api_release_dir }}/coin-api-serviceregistry-client/pom.xml" + - "{{ api_release_dir }}/coin-api-war/pom.xml" + - name: SRC - Running Maven install command: mvn -q clean install -DskipTests args: chdir: "{{ api_release_dir }}" - name: SRC - Copy build to build directory - copy: src="coin-api-dist/target/coin-api-dist-{{ api_version }}-bin.tar.gz" dest={{ api_build_path }} \ No newline at end of file + copy: + src: "{{ api_release_dir }}/coin-api-dist/target/coin-api-dist-{{ api_version_dir }}-bin.tar.gz" + dest: "{{ api_build_path }}" \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml index ba54f84..14f42cf 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml @@ -23,10 +23,15 @@ file: path={{ tomcat_work_path }} owner=tomcat group=tomcat recurse=true state=directory - name: Clean Tomcat work - shell: rm -rvf {{ tomcat_work_path }}/api.{{ openconext_domain }}/* + shell: rm -rvf {{ tomcat_work_path }}/* - name: Install Tomcat webapps directory file: path={{ tomcat_webapps_path }} owner=tomcat group=tomcat recurse=true state=directory - name: Clean Tomcat webapps - shell: rm -rvf {{ tomcat_webapps_path }}/api.{{ openconext_domain }}/* \ No newline at end of file + shell: rm -rvf {{ tomcat_webapps_path }}/* + + - name: Install WAR + copy: + src: "{{ releases_dir }}/coin-api-dist-{{ api_version_dir }}/tomcat/webapps/coin-api-war-{{ api_version_dir }}.war" + dest: "{{ tomcat_webapps_path }}/coin-api-war-{{ api_version_dir }}.war" \ No newline at end of file diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 index 6c1023c..3a4ed0a 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 @@ -7,7 +7,7 @@ janus.user={{ api_janus_user }} janus.secret={{ api_janus_secret }} -janus.uri={{ serviceregistry_url }} +janus.uri={{ api_janus_url }} coin-api.jdbc.driver=com.mysql.jdbc.Driver coin-api.jdbc.url=jdbc:mysql://db.{{ openconext_domain }}:3306/api From 7320c61908c883c4567d5715fc0e08a6b64f756b Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 14 Jul 2014 12:18:59 +0200 Subject: [PATCH 13/21] Don't skip tests when you're building from source, see: https://github.com/OpenConext/OpenConext-api/commit/e90b9374ee092e5992fe9ee6d0eec945049242cd --- .../resources/ansible-openconext-api/tasks/main/install-src.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml index 6a693a4..40ec848 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml @@ -30,7 +30,7 @@ - "{{ api_release_dir }}/coin-api-war/pom.xml" - name: SRC - Running Maven install - command: mvn -q clean install -DskipTests + command: mvn -q clean install args: chdir: "{{ api_release_dir }}" From 6a8d01c9e952d19cf114f6cf084ae4de75c14da7 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Tue, 15 Jul 2014 13:58:55 +0200 Subject: [PATCH 14/21] Dont skip testing when building from source --- .../resources/ansible-openconext-api/tasks/main/install-src.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml index 40ec848..6a693a4 100644 --- a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml +++ b/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml @@ -30,7 +30,7 @@ - "{{ api_release_dir }}/coin-api-war/pom.xml" - name: SRC - Running Maven install - command: mvn -q clean install + command: mvn -q clean install -DskipTests args: chdir: "{{ api_release_dir }}" From d83128625e35ec608dada60942aee285505b554e Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 21 Jul 2014 09:41:20 +0200 Subject: [PATCH 15/21] Move ansible role out of classpath (thanks Hans!) --- .../{resources/ansible-openconext-api => ansible}/meta/main.yml | 0 .../{resources/ansible-openconext-api => ansible}/tasks/erase.yml | 0 .../{resources/ansible-openconext-api => ansible}/tasks/main.yml | 0 .../ansible-openconext-api => ansible}/tasks/main/activate.yml | 0 .../ansible-openconext-api => ansible}/tasks/main/configure.yml | 0 .../tasks/main/install-build.yml | 0 .../ansible-openconext-api => ansible}/tasks/main/install-src.yml | 0 .../ansible-openconext-api => ansible}/tasks/main/install.yml | 0 .../ansible-openconext-api => ansible}/tasks/version.yml | 0 .../templates/api-ehcache.xml.j2 | 0 .../templates/api-logback.full.xml | 0 .../templates/api-logback.minimal.xml | 0 .../templates/api-logback.xml.j2 | 0 .../ansible-openconext-api => ansible}/templates/api.conf.j2 | 0 .../templates/coin-api.properties.j2 | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/meta/main.yml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/tasks/erase.yml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/tasks/main.yml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/tasks/main/activate.yml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/tasks/main/configure.yml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/tasks/main/install-build.yml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/tasks/main/install-src.yml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/tasks/main/install.yml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/tasks/version.yml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/templates/api-ehcache.xml.j2 (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/templates/api-logback.full.xml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/templates/api-logback.minimal.xml (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/templates/api-logback.xml.j2 (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/templates/api.conf.j2 (100%) rename coin-api-dist/src/main/{resources/ansible-openconext-api => ansible}/templates/coin-api.properties.j2 (100%) diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml b/coin-api-dist/src/main/ansible/meta/main.yml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/meta/main.yml rename to coin-api-dist/src/main/ansible/meta/main.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/erase.yml b/coin-api-dist/src/main/ansible/tasks/erase.yml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/tasks/erase.yml rename to coin-api-dist/src/main/ansible/tasks/erase.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml b/coin-api-dist/src/main/ansible/tasks/main.yml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main.yml rename to coin-api-dist/src/main/ansible/tasks/main.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml b/coin-api-dist/src/main/ansible/tasks/main/activate.yml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/activate.yml rename to coin-api-dist/src/main/ansible/tasks/main/activate.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml b/coin-api-dist/src/main/ansible/tasks/main/configure.yml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/configure.yml rename to coin-api-dist/src/main/ansible/tasks/main/configure.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-build.yml b/coin-api-dist/src/main/ansible/tasks/main/install-build.yml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-build.yml rename to coin-api-dist/src/main/ansible/tasks/main/install-build.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml b/coin-api-dist/src/main/ansible/tasks/main/install-src.yml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install-src.yml rename to coin-api-dist/src/main/ansible/tasks/main/install-src.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml b/coin-api-dist/src/main/ansible/tasks/main/install.yml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/tasks/main/install.yml rename to coin-api-dist/src/main/ansible/tasks/main/install.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/tasks/version.yml b/coin-api-dist/src/main/ansible/tasks/version.yml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/tasks/version.yml rename to coin-api-dist/src/main/ansible/tasks/version.yml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-ehcache.xml.j2 b/coin-api-dist/src/main/ansible/templates/api-ehcache.xml.j2 similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-ehcache.xml.j2 rename to coin-api-dist/src/main/ansible/templates/api-ehcache.xml.j2 diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.full.xml b/coin-api-dist/src/main/ansible/templates/api-logback.full.xml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.full.xml rename to coin-api-dist/src/main/ansible/templates/api-logback.full.xml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.minimal.xml b/coin-api-dist/src/main/ansible/templates/api-logback.minimal.xml similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.minimal.xml rename to coin-api-dist/src/main/ansible/templates/api-logback.minimal.xml diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.xml.j2 b/coin-api-dist/src/main/ansible/templates/api-logback.xml.j2 similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/templates/api-logback.xml.j2 rename to coin-api-dist/src/main/ansible/templates/api-logback.xml.j2 diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/api.conf.j2 b/coin-api-dist/src/main/ansible/templates/api.conf.j2 similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/templates/api.conf.j2 rename to coin-api-dist/src/main/ansible/templates/api.conf.j2 diff --git a/coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 b/coin-api-dist/src/main/ansible/templates/coin-api.properties.j2 similarity index 100% rename from coin-api-dist/src/main/resources/ansible-openconext-api/templates/coin-api.properties.j2 rename to coin-api-dist/src/main/ansible/templates/coin-api.properties.j2 From c07813639ea1a785f4e0fdb68662e07f57ef1903 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 21 Jul 2014 10:10:19 +0200 Subject: [PATCH 16/21] Install python-lxml on the destination server so we can edit server.xml with the Ansible module ansible-xml --- coin-api-dist/src/main/ansible/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coin-api-dist/src/main/ansible/tasks/main.yml b/coin-api-dist/src/main/ansible/tasks/main.yml index 97aa33c..cdc2c9a 100644 --- a/coin-api-dist/src/main/ansible/tasks/main.yml +++ b/coin-api-dist/src/main/ansible/tasks/main.yml @@ -1,4 +1,6 @@ --- + - yum: name=python-lxml state=installed + - name: Install API include: main/install.yml From 3af674ebd5d1f9a4303523548cce1f73f74dece9 Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 21 Jul 2014 10:10:55 +0200 Subject: [PATCH 17/21] Set default variables for API --- .../src/main/ansible/defaults/main.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 coin-api-dist/src/main/ansible/defaults/main.yml diff --git a/coin-api-dist/src/main/ansible/defaults/main.yml b/coin-api-dist/src/main/ansible/defaults/main.yml new file mode 100644 index 0000000..8034aad --- /dev/null +++ b/coin-api-dist/src/main/ansible/defaults/main.yml @@ -0,0 +1,35 @@ +--- +temp_dir: "/tmp" +logging_dir: "/var/log/openconext" +releases_dir: "/opt/openconext" +builds_dir: "{{ releases_dir }}/builds" +configs_dir: "/etc/openconext" + +# Tomcat vars +tomcat_path: "/usr/share/tomcat6" +tomcat_conf_path: "{{ tomcat_path }}/conf" +tomcat_wars_path: "{{ tomcat_path }}/wars" +tomcat_work_path: "{{ tomcat_path }}/work/Catalina/api.{{ openconext_domain }}" +tomcat_webapps_path: "{{ tomcat_path }}/webapps/api.{{ openconext_domain }}" +tomcat_classpath_path: "{{ tomcat_path }}/conf/classpath_properties" + +# API specific variables +api_git_url: "https://github.com/OpenConext/OpenConext-api.git" +api_version_dir: "{{ api_version | replace('/', '-') }}" +api_release_dir: "{{ releases_dir }}/OpenConext-api-{{ api_version_dir }}" +api_build_path: "{{ builds_dir }}/coin-api-dist-{{ api_version_dir }}-bin.tar.gz" +api_download_url: "https://build.surfconext.nl/repository/public/releases/org/surfnet/coin/coin-api-dist/{{ api_version }}/coin-api-dist-{{ api_version }}-bin.tar.gz" +api_dist_war_path: "{{ releases_dir }}/coin-api-dist-{{ api_version_dir }}/tomcat/webapps/coin-api-war-{{ api_version_dir }}.war" +api_tomcat_war_path: "{{ tomcat_wars_path }}/coin-api-war-{{ api_version_dir }}.war" + +# Choice: "full" or "minimal" +api_logging_policy: minimal +api_db_name: api +api_db_host: "db.{{ openconext_domain}}" +api_db_port: 3306 +api_janus_url: https://serviceregistry.{{ openconext_domain }}/simplesaml/module.php/janus/services/rest/ +db_admin_user: root +engine_db_name: engineblock +engine_db_host: localhost +engine_db_port: 3306 +teams_db_name: teams From 208c83f5302b0cee166070dd3963e0b932b2d4be Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 21 Jul 2014 10:12:00 +0200 Subject: [PATCH 18/21] Ensure that the directories we use for installing and building actually exist --- coin-api-dist/src/main/ansible/tasks/main/install.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/coin-api-dist/src/main/ansible/tasks/main/install.yml b/coin-api-dist/src/main/ansible/tasks/main/install.yml index 14f42cf..40457b3 100644 --- a/coin-api-dist/src/main/ansible/tasks/main/install.yml +++ b/coin-api-dist/src/main/ansible/tasks/main/install.yml @@ -1,4 +1,11 @@ --- + - name: Ensure the directories exists + file: path={{ item }} state=directory + with_items: + - "{{ releases_dir }}" + - "{{ builds_dir }}" + - "{{ configs_dir }}" + - name: Install API from Build (only when version starts with a number) include: install-build.yml when: api_version | match("^[0-9]") From b3f8acd4dd4bdf59512eb67df2a711c5ab83427c Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 21 Jul 2014 10:13:40 +0200 Subject: [PATCH 19/21] Ansible bugfix: Copy is meant for local -> remote not for actions on the remote --- coin-api-dist/src/main/ansible/tasks/main/install.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/coin-api-dist/src/main/ansible/tasks/main/install.yml b/coin-api-dist/src/main/ansible/tasks/main/install.yml index 40457b3..af67a9e 100644 --- a/coin-api-dist/src/main/ansible/tasks/main/install.yml +++ b/coin-api-dist/src/main/ansible/tasks/main/install.yml @@ -39,6 +39,4 @@ shell: rm -rvf {{ tomcat_webapps_path }}/* - name: Install WAR - copy: - src: "{{ releases_dir }}/coin-api-dist-{{ api_version_dir }}/tomcat/webapps/coin-api-war-{{ api_version_dir }}.war" - dest: "{{ tomcat_webapps_path }}/coin-api-war-{{ api_version_dir }}.war" \ No newline at end of file + command: cp {{ api_dist_war_path }} {{ api_tomcat_war_path }} \ No newline at end of file From 102c8469e2bf21418a1b059114ad91ded578332a Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 21 Jul 2014 10:14:17 +0200 Subject: [PATCH 20/21] Ansible: set a mailserver even though it isn't used because otherwise API will complain... --- .../src/main/ansible/templates/coin-api.properties.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coin-api-dist/src/main/ansible/templates/coin-api.properties.j2 b/coin-api-dist/src/main/ansible/templates/coin-api.properties.j2 index 3a4ed0a..c6a7033 100644 --- a/coin-api-dist/src/main/ansible/templates/coin-api.properties.j2 +++ b/coin-api-dist/src/main/ansible/templates/coin-api.properties.j2 @@ -51,6 +51,10 @@ groupServiceClass=nl.surfnet.coin.api.service.GroupServiceImpl #Is the mock API enabled? mock-api-enabled=false +# SMTP server settings for notifications +coin-mailserver=localhost +coin-mailserver-port=25 + #The directory (in the war) where the db migration scrips reside coin-api.db.migrations.folder=db/migration/mysql From f00709a367149b671390577ca6fb60189243c6db Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Mon, 21 Jul 2014 10:14:37 +0200 Subject: [PATCH 21/21] Added a debugging profile for api logging --- .../ansible/templates/api-logback.debug.xml | 108 ++++++++++++++++++ .../main/ansible/templates/api-logback.xml.j2 | 0 2 files changed, 108 insertions(+) create mode 100644 coin-api-dist/src/main/ansible/templates/api-logback.debug.xml delete mode 100644 coin-api-dist/src/main/ansible/templates/api-logback.xml.j2 diff --git a/coin-api-dist/src/main/ansible/templates/api-logback.debug.xml b/coin-api-dist/src/main/ansible/templates/api-logback.debug.xml new file mode 100644 index 0000000..e71f5a3 --- /dev/null +++ b/coin-api-dist/src/main/ansible/templates/api-logback.debug.xml @@ -0,0 +1,108 @@ + + + + + + + ${CATALINA_BASE}/logs/api.log + + + ${CATALINA_BASE}/logs/api-%d{yyyy-MM-dd}.log.gz + 60 + + + %d{ISO8601} %5p [%t] %logger{40}:%L - %m%n + + + + + + info + + + + + nl.surfnet.coin + debug + + + org.springframework + warn + + + org.hibernate + warn + + + org.opensaml + warn + + + org.apache + warn + + + hsqldb.db + warn + + + + + ${CATALINA_BASE}/logs/api-fc.log + + + ${CATALINA_BASE}/logs/api-%d{yyyy-MM-dd}.log.gz + 60 + + + %d{ISO8601} %5p [%t] %logger{40}:%L - %m%n + + + + + + + + org.springframework + info + + + org.opensaml + info + + + org.apache + info + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/coin-api-dist/src/main/ansible/templates/api-logback.xml.j2 b/coin-api-dist/src/main/ansible/templates/api-logback.xml.j2 deleted file mode 100644 index e69de29..0000000