add script + playbook for modernpaste paste deactivation
Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
This commit is contained in:
parent
cc94f5d4ea
commit
13179ee96b
3 changed files with 23 additions and 0 deletions
11
playbooks/deactivate_modernpaste_paste.yml
Normal file
11
playbooks/deactivate_modernpaste_paste.yml
Normal 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}}"
|
7
roles/modernpaste/files/deactivate-paste.py
Normal file
7
roles/modernpaste/files/deactivate-paste.py
Normal 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])))
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue