retry
This commit is contained in:
parent
dcf42d7ab9
commit
0270b39b8d
|
@ -15,7 +15,7 @@ pipeline:
|
|||
- apk --update add ansible py3-requests curl
|
||||
- ansible-galaxy collection build
|
||||
- ansible-galaxy collection install markuman-nextcloud-*
|
||||
- ansible-playbook tests/integration.yml
|
||||
- cd tests/integration/targets/ && ansible-playbook woodpecker.yml
|
||||
|
||||
services:
|
||||
nextcloud21:
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
---
|
||||
- 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
|
||||
|
||||
- name: get nc users
|
||||
markuman.nextcloud.user_info:
|
||||
ssl_mode: http
|
||||
register: out
|
||||
|
||||
- name: verify change
|
||||
assert:
|
||||
that:
|
||||
- out.users | count == 1
|
Loading…
Reference in New Issue