forked from markuman/markuman.nextcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of git.osuv.de:m/nextcloud_collection
- Loading branch information
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
- hosts: localhost | ||
connection: local | ||
gather_facts: no | ||
|
||
tasks: | ||
- name: wait for nextcloud (pull image and install) | ||
get_url: | ||
url: http://nextcloud21 | ||
dest: /tmp/test | ||
register: status | ||
until: status.failed == false | ||
delay: 5 | ||
retries: 50 | ||
|
||
- name: test | ||
block: | ||
########### prepair | ||
- name: Download ansible.svg from wikipedia | ||
get_url: | ||
url: https://de.wikipedia.org/wiki/Ansible#/media/Datei:Ansible_logo.svg | ||
dest: /tmp/ansible.svg | ||
|
||
########### test | ||
- name: upload file on nextcloud | ||
markuman.nextcloud.file: | ||
mode: put | ||
src: /tmp/ansible.svg | ||
dest: ansible.svg | ||
ssl_mode: http | ||
register: out_state | ||
|
||
- name: state must be changed | ||
assert: | ||
that: | ||
- out_state is changed | ||
|
||
- name: GET file from nextcloud | ||
markuman.nextcloud.file: | ||
mode: get | ||
src: ansible.svg | ||
dest: /tmp/tmp.svg | ||
ssl_mode: http | ||
register: out_state | ||
|
||
- name: state must be changed | ||
assert: | ||
that: | ||
- out_state is changed | ||
|
||
- name: OK fetch file from nextcloud | ||
markuman.nextcloud.file: | ||
mode: get | ||
src: ansible.svg | ||
dest: /tmp/ansible.svg | ||
overwritten: different | ||
ssl_mode: http | ||
register: out_state | ||
|
||
- name: state must not be changed | ||
assert: | ||
that: | ||
- out_state is not changed | ||
|
||
- name: delete file on nextcloud | ||
markuman.nextcloud.file: | ||
mode: delete | ||
src: ansible.svg | ||
ssl_mode: http | ||
register: out_state | ||
|
||
- name: state must be changed | ||
assert: | ||
that: | ||
- out_state is changed | ||
|
||
- name: immutable delete file on nextcloud | ||
markuman.nextcloud.file: | ||
mode: delete | ||
src: ansible.svg | ||
ssl_mode: http | ||
register: out_state | ||
|
||
- name: state must not be changed | ||
assert: | ||
that: | ||
- out_state is not changed |