mirror of
https://github.com/MHA-Team/PTS-Team.git
synced 2026-02-27 15:32:50 +00:00
50 lines
1.3 KiB
Bash
50 lines
1.3 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Title: Missing Pull Checker
|
|
# Author(s): MrDoobPG
|
|
# GNU: General Public License v3.0
|
|
################################################################################
|
|
---
|
|
- hosts: localhost
|
|
gather_facts: false
|
|
tasks:
|
|
- name: 'Register Path'
|
|
shell: 'cat /var/plexguide/pg.number'
|
|
register: serverid
|
|
|
|
- name: 'Check folder exist'
|
|
stat:
|
|
path: /opt/plexguide/menu/pg.yml
|
|
register: stat_result
|
|
- debug:
|
|
msg: "PTS Check for missing pull"
|
|
|
|
- name: 'Installing Version {{serverid.stdout}}'
|
|
git:
|
|
repo: 'https://github.com/PTS-Team/PTS-Team'
|
|
dest: '/opt/plexguide'
|
|
clone: yes
|
|
version: '{{serverid.stdout}}'
|
|
force: yes
|
|
update: yes
|
|
become: yes
|
|
when: stat_result.stat.exists == False
|
|
ignore_errors: yes
|
|
|
|
- stat:
|
|
path: /opt/plexguide/menu
|
|
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/plexguide/LICENSE'
|
|
- '/opt/plexguide/README.md'
|
|
|
|
- name: 'Stops First Time Run'
|
|
shell: 'touch /var/plexguide/ask.yes'
|
|
register: program
|