forked from HawksRepos/Install
-
Notifications
You must be signed in to change notification settings - Fork 18
/
clone.yml
80 lines (69 loc) · 2.12 KB
/
clone.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
#
# Title: PTS Install base
# Author(s): MrDoobPG
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
- name: 'Check folder exist'
stat:
path: /opt/pgstage
register: stat_result
- debug:
msg: "PTS Check for missing pull"
- name: 'Cloning PTS Install files'
git:
repo: 'https://github.com/MHA-Team/PTS-Team'
dest: /opt/plexguide
clone: yes
version: 'master'
force: yes
update: yes
become: yes
- stat:
path: /opt/pgstage
register: p
- debug:
msg: "Path exists and PTS folder are pulled"
when: p.stat.isdir is defined and p.stat.isdir
- name: Remove .githube folder and .git files
file: 'path={{item}} state=absent mode=0775 owner=1000 group=1000'
with_items:
- '/opt/pgstage/.git'
- '/opt/pgstage/.github'
- '/opt/pgstage/.gitignore'
- '/opt/pgstage/LICENSE'
- '/opt/pgstage/README.md'
- name: Check if Image Variable Exists
stat:
path: '/opt/communityapps'
register: pathcheck
- name: 'Transfer Image Variable'
shell: 'rm -rf /opt/communityapps'
when: pathcheck.stat.exists
- name: Cloning Community Apps
git:
repo: 'https://github.com/MHA-Team/Apps-Community'
dest: /opt/communityapps
version: 'master'
force: yes
- name: Set Permission and Owner
shell: 'chown -R 1000:1000 /opt/communityapps && chmod -R 775 /opt/communityapps'
- name: Check if Image Variable Exists
stat:
path: '/opt/coreapps'
register: pathcheck
- name: 'Transfer Image Variable'
shell: 'rm -rf /opt/coreapps'
when: pathcheck.stat.exists
- name: Cloning Core Apps
git:
repo: 'https://github.com/MHA-Team/Apps-Core'
dest: /opt/coreapps
version: 'master'
force: yes
- name: Set Permission and Owner
shell: 'chown -R 1000:1000 /opt/coreapps && chmod -R 775 /opt/coreapps'