diff --git a/helpers/ansible-shreddit.yml b/helpers/ansible-shreddit.yml deleted file mode 100644 index 76de711..0000000 --- a/helpers/ansible-shreddit.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- hosts: ro - vars: - user: napalm - install_dir: "/home/{{ user }}/Shreddit" - tasks: - - name: Update the Shreddit repository - git: repo=https://github.com/x89/Shreddit.git dest={{ install_dir }} - - name: Ensure shreddit.cfg is correct - copy: src=shreddit.cfg dest={{ install_dir }}/shreddit.cfg owner={{ user }} group={{ user }} mode=0600 - - name: Ensure praw.ini is correct - copy: src=praw.ini dest={{ install_dir }}/praw.ini owner={{ user }} group={{ user }} mode=0600 - - name: Run get_secret.py to check that we can login with oauth - shell: bash -c "source .venv/bin/activate && python get_secret.py" chdir={{ install_dir }} - - name: Ensure Shreddit cron job - cron: user={{ user }} name="Shreddit" minute="0" job="cd {{ install_dir }} && bash -c 'source .venv/bin/activate && python shreddit.py' 2>/dev/null" - - name: Run a test Shreddit run - shell: bash -c "source .venv/bin/activate && python shreddit.py" chdir={{ install_dir }} diff --git a/lambda_handler.py b/lambda_handler.py deleted file mode 100644 index e7e7d97..0000000 --- a/lambda_handler.py +++ /dev/null @@ -1,12 +0,0 @@ -"""This module contains the handler function called by AWS. -""" -from shreddit.shredder import shred -import yaml - - -def lambda_handler(event, context): - with open("shreddit.yml") as fh: - config = yaml.safe_load(fh) - if not config: - raise Exception("No config options passed!") - shred(config)