Skip to content

Commit 63b4c08

Browse files
committed
Add App Deployment Demo
1 parent 3358a05 commit 63b4c08

File tree

6 files changed

+72
-0
lines changed

6 files changed

+72
-0
lines changed

app_deployment_demo/ansible.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[defaults]
2+
inventory = ./inventory
3+
forks = 50
4+
retry_files_enabled = False
5+
no_target_syslog = False
6+
stdout_callback = default
7+
bin_ansible_callbacks = True
8+
callback_whitelist = yaml, timer, profile_tasks
9+
host_key_checking = False
10+
11+
[persistent_connection]
12+
connect_timeout = 30
13+
connect_retries = 30
14+
connect_interval = 1

app_deployment_demo/deploy_app.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- name: Deploy Application
3+
hosts: app-server1
4+
become: yes
5+
gather_facts: false
6+
7+
roles:
8+
- deploy_app
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- name: Download Package
3+
hosts: jenkins
4+
gather_facts: false
5+
6+
roles:
7+
- download_package
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
f5_lb_method: 'round-robin'
3+
f5_monitors: '/Common/http'
4+
f5_pool_name: 'http_pool'
5+
f5_provider:
6+
server: "{{ f5_bigip_server }}"
7+
user: "{{ f5_bigip_user }}"
8+
password: "{{ f5_bigip_password }}"
9+
server_port: 8443
10+
f5_virtual_server: 'webapp_vip'
11+
infoblox_username: 'cloudadmin'
12+
nios_provider:
13+
host: "{{ grid_manager }}"
14+
username: "{{ infoblox_username }}"
15+
password: "{{ infoblox_password }}"
16+
paloalto_username: 'admin'
17+
subnet_netmask: '255.255.255.0'
18+
vm_domain: 'domain.com'
19+
vm_network: 'VM Network'
20+
webapp_port: 80
21+
workflow_tower_inventory: 'VMWare_Workflow'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
- name: "Check for any existing running process of {{ app_name }}"
3+
shell: "ps -ef | grep {{ app_name }} | grep -v grep | awk '{print $2}'"
4+
register: app_process_id
5+
6+
- name: Terminate existing process
7+
command: "kill -9 {{ app_process_id.stdout }}"
8+
when: app_process_id.stdout != ''
9+
10+
- name: Copy Package
11+
copy:
12+
src: "/tmp/{{ app_name }}.jar"
13+
dest: "{{ app_folder }}/{{ app_name }}.jar"
14+
15+
- name: Deploy Software
16+
shell: "nohup java -jar {{ app_folder }}/{{ app_name }}.jar &"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
- name: Download Package
3+
fetch:
4+
src: "{{ package_download_path }}/{{ app_name }}.jar"
5+
dest: "/tmp/{{ app_name }}.jar"
6+
flat: yes

0 commit comments

Comments
 (0)