This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #367 from C0nsultant/ansible-verifyupdates
Ansible - Verify that updates between versions work
- Loading branch information
Showing
12 changed files
with
276 additions
and
77 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
--- | ||
- name: fresh installation | ||
hosts: all | ||
tasks: | ||
- name: install paperless-ng with default parameters | ||
include_role: | ||
name: ansible |
File renamed without changes.
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,60 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
|
||
vars_files: | ||
- ../../defaults/main.yml | ||
|
||
tasks: | ||
- name: check if webserver is up | ||
uri: | ||
url: http://localhost:8000 | ||
status_code: [200, 302] | ||
return_content: yes | ||
register: landingpage | ||
failed_when: "'Sign in</button>' not in landingpage.content" | ||
|
||
- name: check if document posting works | ||
uri: | ||
url: http://localhost:8000/api/documents/post_document/ | ||
method: POST | ||
body_format: form-multipart | ||
body: | ||
document: | ||
content: FOO | ||
filename: document.txt | ||
mime_type: text/plain | ||
headers: | ||
Authorization: 'Basic {{ (paperlessng_superuser_name + ":" + paperlessng_superuser_password) | b64encode }}' | ||
return_content: yes | ||
register: post_document | ||
failed_when: "'OK' not in post_document.content" | ||
|
||
- name: verify uploaded document has been accepted | ||
uri: | ||
url: http://localhost:8000/api/logs/ | ||
headers: | ||
Authorization: 'Basic {{ (paperlessng_superuser_name + ":" + paperlessng_superuser_password) | b64encode }}' | ||
return_content: yes | ||
register: logs | ||
failed_when: "'Consuming document.txt' not in logs.content" | ||
|
||
# assumes txt consumption finished by now, might have to sleep a bit | ||
- name: verify uploaded document has been consumed | ||
uri: | ||
url: http://localhost:8000/api/logs/ | ||
headers: | ||
Authorization: 'Basic {{ (paperlessng_superuser_name + ":" + paperlessng_superuser_password) | b64encode }}' | ||
return_content: yes | ||
register: logs | ||
failed_when: "'document consumption finished' not in logs.content" | ||
|
||
- name: verify uploaded document is avaiable | ||
uri: | ||
url: http://localhost:8000/api/documents/1/ | ||
headers: | ||
Authorization: 'Basic {{ (paperlessng_superuser_name + ":" + paperlessng_superuser_password) | b64encode }}' | ||
return_content: yes | ||
register: document | ||
failed_when: "'Not found.' in document.content or 'FOO' not in document.content" |
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,11 @@ | ||
--- | ||
- name: update previous release to newest release | ||
hosts: all | ||
tasks: | ||
- name: set current version as installation target | ||
set_fact: | ||
paperlessng_version: 0.9.14 | ||
|
||
- name: update to newest paperless-ng release | ||
include_role: | ||
name: ansible |
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,35 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: ubuntu_focal | ||
image: jrei/systemd-ubuntu:20.04 | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
tmpfs: | ||
- /tmp | ||
- /run | ||
- /run/lock | ||
override_command: False | ||
# ubuntu 18.04 bionic works except that | ||
# the default redis configuration expects IPv6 which is not enabled in docker by default | ||
# the default Python environment is configured for ASCII instead of UTF-8 | ||
# ubuntu 16.04 xenial only has Python 3.5 which is EOL and breaks multiple dependencies | ||
- name: debian_buster | ||
image: jrei/systemd-debian:10 | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
tmpfs: | ||
- /tmp | ||
- /run | ||
- /run/lock | ||
override_command: False | ||
# debian 9 stretch only has Python 3.5 which is EOL and breaks multiple dependencies | ||
provisioner: | ||
name: ansible | ||
verifier: | ||
name: ansible |
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,10 @@ | ||
- name: install previous release | ||
hosts: all | ||
tasks: | ||
- name: set previous version as installation target | ||
set_fact: | ||
paperlessng_version: 0.9.13 | ||
|
||
- name: install previous paperless-ng release | ||
include_role: | ||
name: ansible |
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,60 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
|
||
vars_files: | ||
- ../../defaults/main.yml | ||
|
||
tasks: | ||
- name: check if webserver is up | ||
uri: | ||
url: http://localhost:8000 | ||
status_code: [200, 302] | ||
return_content: yes | ||
register: landingpage | ||
failed_when: "'Sign in</button>' not in landingpage.content" | ||
|
||
- name: check if document posting works | ||
uri: | ||
url: http://localhost:8000/api/documents/post_document/ | ||
method: POST | ||
body_format: form-multipart | ||
body: | ||
document: | ||
content: FOO | ||
filename: document.txt | ||
mime_type: text/plain | ||
headers: | ||
Authorization: 'Basic {{ (paperlessng_superuser_name + ":" + paperlessng_superuser_password) | b64encode }}' | ||
return_content: yes | ||
register: post_document | ||
failed_when: "'OK' not in post_document.content" | ||
|
||
- name: verify uploaded document has been accepted | ||
uri: | ||
url: http://localhost:8000/api/logs/ | ||
headers: | ||
Authorization: 'Basic {{ (paperlessng_superuser_name + ":" + paperlessng_superuser_password) | b64encode }}' | ||
return_content: yes | ||
register: logs | ||
failed_when: "'Consuming document.txt' not in logs.content" | ||
|
||
# assumes txt consumption finished by now, might have to sleep a bit | ||
- name: verify uploaded document has been consumed | ||
uri: | ||
url: http://localhost:8000/api/logs/ | ||
headers: | ||
Authorization: 'Basic {{ (paperlessng_superuser_name + ":" + paperlessng_superuser_password) | b64encode }}' | ||
return_content: yes | ||
register: logs | ||
failed_when: "'document consumption finished' not in logs.content" | ||
|
||
- name: verify uploaded document is avaiable | ||
uri: | ||
url: http://localhost:8000/api/documents/1/ | ||
headers: | ||
Authorization: 'Basic {{ (paperlessng_superuser_name + ":" + paperlessng_superuser_password) | b64encode }}' | ||
return_content: yes | ||
register: document | ||
failed_when: "'Not found.' in document.content or 'FOO' not in document.content" |
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
Oops, something went wrong.