Skip to content

Commit

Permalink
Place a simple default page.
Browse files Browse the repository at this point in the history
Relates #20
  • Loading branch information
robertdebock committed Aug 26, 2020
1 parent 0510b77 commit dccceb5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
12 changes: 12 additions & 0 deletions tasks/instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -43,18 +45,28 @@
template:
src: server.xml.j2
dest: "{{ tomcat_directory }}/{{ instance.name }}/conf/server.xml"
mode: "0644"
notify:
- restart tomcat instance

- name: configure tomcat instance - setenv.sh
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
Expand Down

0 comments on commit dccceb5

Please sign in to comment.