From dccceb59a25fb19dac7dc3e9f194b20afe76612c Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Wed, 26 Aug 2020 21:18:02 +0200 Subject: [PATCH] Place a simple default page. Relates #20 --- molecule/default/verify.yml | 8 ++++++++ tasks/instance.yml | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index 43f8b6c..c47fb82 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -19,3 +19,11 @@ - name: let netcat listen on port 127.0.0.2:8080 shell: nc --listen --keep-open 127.0.0.2 8080 & + + - name: see if sensitive information is not exposed + uri: + url: "http://localhost:8080/" + return_content: yes + register: this + failed_when: + - "'successfully installed Tomcat' in this.content" diff --git a/tasks/instance.yml b/tasks/instance.yml index 90d3341..9f67560 100644 --- a/tasks/instance.yml +++ b/tasks/instance.yml @@ -18,6 +18,7 @@ state: directory owner: "{{ instance.user | default(tomcat_user) }}" group: "{{ instance.group | default(tomcat_group) }}" + mode: "0755" - name: download tomcat source get_url: @@ -34,6 +35,7 @@ remote_src: yes extra_opts: "--strip-components=1" creates: "{{ tomcat_directory }}/{{ instance.name }}/bin" + mode: "0755" - name: save instance name set_fact: @@ -43,6 +45,7 @@ template: src: server.xml.j2 dest: "{{ tomcat_directory }}/{{ instance.name }}/conf/server.xml" + mode: "0644" notify: - restart tomcat instance @@ -50,11 +53,20 @@ template: src: setenv.sh.j2 dest: "{{ tomcat_directory }}/{{ instance.name }}/bin/setenv.sh" + mode: "0644" when: - (instance.java_opts is defined) or (instance.xms is defined) or (instance.xmx is defined) notify: - restart tomcat instance +- name: place neutral default page + copy: + content: "Please select an application by adding the context to the URL." + dest: "{{ tomcat_directory }}/{{ instance.name }}/webapps/ROOT/index.html" + owner: "{{ instance.user | default(tomcat_user) }}" + group: "{{ instance.group | default(tomcat_group) }}" + mode: "0640" + - name: create service instance import_role: name: robertdebock.service