-
Notifications
You must be signed in to change notification settings - Fork 0
/
wget.yml
executable file
·34 lines (34 loc) · 1.23 KB
/
wget.yml
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
---
- hosts: [kavin]
vars:
namespace: ansible
ftp_username: username
ftp_password: 'password'
ftp_location: url
tomcat_dir: path/to/folder/
backup_dir: path/to/folder/{{ date1 }}/
date1: backup_{{ lookup('pipe', 'date +%Y%m%d_%H%M%S') }}
date: patch_{{ lookup('pipe', 'date +%Y%m%d') }}
patch_dir: "{{ date }}"
tasks:
# - name: restart fusion
# service: name=fusion state=stopped
- name: Prepare download folder
sudo: true
action: shell sudo mkdir -p /root/{{ date }}
# - name: Fix permissions
# shell: 'chmod 755 -R /root/{{ date }}'
# shell: 'chown exterro:exterro -R /root/{{ date }}'
- name: download file from ftp
sudo: true
shell: "chdir=/root/{{ date }} wget --user={{ ftp_username }} --password='{{ ftp_password }}' ftp://{{ ftp_location }}{{ location }}"
# - name: copy and backup file
# action: shell mkdir -p {{ backup_dir }}
# - name: backup file
# action: shell cp -r {{ tomcat_dir }}/deploy/* {{ backup_dir }}
# - name: Move file
# action: shell cp -r {{ date }}/* {{ tomcat_dir }}/deploy/
# - name: start fusion
# service: name=fusion state=started
# - name: Delete Patch download
# shell: rm -rf {{ date }}