From f7da221627ba82095342716fd3f77c7822979278 Mon Sep 17 00:00:00 2001 From: jdvega Date: Wed, 20 Dec 2017 17:36:31 +0100 Subject: [PATCH 1/3] set a name for downloaded file, change dockerfile to use java-based image --- defaults/main.yml | 5 +++-- tasks/deploy.yml | 6 +++--- tests/Dockerfile | 4 ++-- tests/playbook.yml | 3 +-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 92703c2..be24f73 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -54,7 +54,8 @@ tomcat_users: ## Deploy tomcat_download_wars: true tomcat_war_to_deploy_urls: - - https://tomcat.apache.org/tomcat-8.5-doc/appdev/sample/sample.war + - url: https://tomcat.apache.org/tomcat-8.5-doc/appdev/sample/sample.war + name: sample.war tomcat_local_wars: false tomcat_war_to_deploy_path: - - "{{ playbook_dir }}/sample.war" \ No newline at end of file + - "{{ playbook_dir }}/sample.war" diff --git a/tasks/deploy.yml b/tasks/deploy.yml index 3f1c399..ddf5ea7 100644 --- a/tasks/deploy.yml +++ b/tasks/deploy.yml @@ -2,8 +2,8 @@ - name: Tomcat | Download wars on webapps get_url: - url: "{{ item }}" - dest: "{{ tomcat_webapps_path }}" + url: "{{ item.url }}" + dest: "{{ tomcat_webapps_path }}/{{ item.name }}" mode: 0755 validate_certs: no with_items: "{{ tomcat_war_to_deploy_urls }}" @@ -16,4 +16,4 @@ dest: "{{ tomcat_webapps_path }}" mode: 0755 with_items: "{{ tomcat_war_to_deploy_path }}" - when: tomcat_local_wars \ No newline at end of file + when: tomcat_local_wars diff --git a/tests/Dockerfile b/tests/Dockerfile index 3ac2a77..082c1ef 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -1,5 +1,5 @@ -FROM geerlingguy/docker-debian9-ansible:latest +FROM idealista/java-role:latest # This is to override Testinfra issue with Debian 9 Docker image RUN touch /tmp/systemd -RUN ln -s /tmp/systemd /sbin/init \ No newline at end of file +RUN ln -s /tmp/systemd /sbin/init diff --git a/tests/playbook.yml b/tests/playbook.yml index 7c5f622..36f2beb 100644 --- a/tests/playbook.yml +++ b/tests/playbook.yml @@ -9,5 +9,4 @@ with_items: - net-tools roles: - - role: java - - role: tomcat-role \ No newline at end of file + - role: tomcat-role From 7ba6380964ecf257b2545686d3298e3aa511bc19 Mon Sep 17 00:00:00 2001 From: jdvega Date: Thu, 21 Dec 2017 10:15:06 +0100 Subject: [PATCH 2/3] fix vagrant platform test --- tests/Dockerfile | 2 +- tests/playbook.yml | 3 ++- tests/test_ansible.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Dockerfile b/tests/Dockerfile index 082c1ef..2707399 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -1,5 +1,5 @@ FROM idealista/java-role:latest -# This is to override Testinfra issue with Debian 9 Docker image +# This is to override Testinfra issue with Idealista Java Docker image RUN touch /tmp/systemd RUN ln -s /tmp/systemd /sbin/init diff --git a/tests/playbook.yml b/tests/playbook.yml index 36f2beb..37e9af7 100644 --- a/tests/playbook.yml +++ b/tests/playbook.yml @@ -9,4 +9,5 @@ with_items: - net-tools roles: - - role: tomcat-role + - java + - tomcat-role diff --git a/tests/test_ansible.py b/tests/test_ansible.py index a9e34a1..15b8834 100644 --- a/tests/test_ansible.py +++ b/tests/test_ansible.py @@ -23,5 +23,5 @@ def test_tomcat_service(File, Service, Socket, AnsibleDefaults): assert File("/lib/systemd/system/tomcat.service").exists assert Service("tomcat").is_enabled assert Service("tomcat").is_running - assert Socket("tcp://0.0.0.0:" + str(ajp_port)).is_listening - assert Socket("tcp://0.0.0.0:" + str(http_port)).is_listening + assert Socket("tcp://0.0.0.0:" + str(ajp_port)).is_listening or Socket("tcp://:::" + str(ajp_port)).is_listening + assert Socket("tcp://0.0.0.0:" + str(http_port)).is_listening or Socket("tcp://:::" + str(http_port)).is_listening From 0ec0d294bd5e4c06a5867e06951d60ed20fd3f69 Mon Sep 17 00:00:00 2001 From: jdvega Date: Thu, 21 Dec 2017 11:28:38 +0100 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14ae841..8e6cbb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ## [Unreleased](https://github.com/idealista/tomcat-role/tree/develop) +## [1.2.0](https://github.com/idealista/tomcat-role/tree/1.2.0) + +### Added +- *[#5](https://github.com/idealista/tomcat-role/issues/5) Add a name for the downloaded war during deployment* @jdvr + ## [1.1.2](https://github.com/idealista/tomcat-role/tree/1.1.2) ### Fixed