-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_tier.ym.ori
45 lines (37 loc) · 1.01 KB
/
app_tier.ym.ori
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
- name: Deploy Application Tier
hosts: app_servers
gather_facts: false
become: true
vars:
postgres_rhel7_repo: "https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
app_server_packages:
- tomcat
- python-psycopg2
app_server_port: 8080
app_server_service: tomcat
tags:
- app_servers
tasks:
- name: Install Tomcat package(s)
package:
name: "{{ app_server_packages }}"
state: present
- name: Enable Tomcat at boot
service:
name: tomcat
enabled: yes
- name: Create Tomcat content directory
file:
path: /usr/share/tomcat/webapps/ROOT
state: directory
- name: Copy static index.html to tomcat webapps/ansible/index.html
template:
src: index.html.j2
dest: /usr/share/tomcat/webapps/ROOT/index.html
mode: 0644
- name: Start Tomcat
service:
name: "{{ app_server_service }}"
state: started
...