first commit

This commit is contained in:
2021-08-28 23:54:41 +08:00
commit 06f4bf327a
55 changed files with 650 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
task: none
root_dir: /attachment
apk: none

3
roles/apk/tasks/main.yml Normal file
View File

@@ -0,0 +1,3 @@
---
- import_tasks: "{{task|lower}}.yml"

View File

@@ -0,0 +1,9 @@
---
- name: check whether {{apk}}.apk.bak exists
shell: cd {{root_dir}} && [ -f {{apk}}.apk.bak ]
ignore_errors: true
register: result
- name: revert {{apk}}.apk.bak
when: result is succeeded
shell: cd {{root_dir}} && rm -f {{apk}}.apk && mv {{apk}}.apk.bak {{apk}}.apk

View File

@@ -0,0 +1,15 @@
---
- name: upload {{apk}}.apk.zip
copy: src=/gxfp/transfer/{{apk}}.apk.zip dest={{root_dir}}/{{apk}}.zip
- name: check whether {{apk}}.apk exists
shell: cd {{root_dir}} && [ -f {{apk}}.apk ]
ignore_errors: true
register: result
- name: remove old {{apk}}.apk.bak
shell: cd {{root_dir}} && rm -f {{apk}}.apk.bak
- name: create current {{apk}}.apk.bak
shell: cd {{root_dir}} && mv {{apk}}.apk {{apk}}.apk.bak
when: result is succeeded
- name: unzip new {{apk}}.zip
shell: cd {{root_dir}} && unzip -o -qq {{apk}}.zip && rm -f {{apk}}.zip