add script + playbook for modernpaste paste deactivation

Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
This commit is contained in:
Rick Elrod 2016-12-05 18:35:13 +00:00
parent cc94f5d4ea
commit 13179ee96b
3 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,11 @@
# requires --extra-vars="target='modernpaste01.phx2.fedoraprjoect.org' paste='WMk4~kSfeW1OUNsLjF8hlMnRi-rYnlYzizqToCmG3BY='"
# where target is the box to run it on (usually modernpaste01.phx2 or modernpaste01.stg.phx2)
# and where paste is the encrypted paste ID of the paste.
- name: Deactivates a modern-paste paste
hosts: "{{ target }}"
user: root
tasks:
- name: Run deactivate-paste.py
command: "python /usr/local/bin/deactivate-paste.py {{paste}}"

View file

@ -0,0 +1,7 @@
#!/usr/bin/env python
import sys
sys.path.append('/usr/share/modern-paste/app')
from util.cryptography import get_decid
from database.paste import deactivate_paste
print(deactivate_paste(get_decid(sys.argv[1])))

View file

@ -39,6 +39,11 @@
- modernpaste
notify: reload httpd
- name: Script for manual paste deactivation
copy: src=deactivate-paste.py dest=/usr/local/bin/deactivate-paste.py owner=root group=root mode=755
tags:
- modernpaste
- name: set sebooleans so paste can talk to the db
seboolean: name=httpd_can_network_connect_db state=true persistent=true
tags: