project-config/playbooks/maintain-github-mirror/run.yaml
Thierry Carrez baa350ef23 maintain-github-mirror: add requests dependency
maintain-github-mirror makes direct use of the requests module. That
module is currently installed as a dependency of PyGithub, but that's
brittle, as PyGithub may well opt for a different library in the
future.

Let's proactively fix that before it bites us.

Change-Id: I8fc288e6c3978e20ddf48f905968931f89834e53
2020-07-13 17:07:07 +02:00

33 lines
849 B
YAML

- hosts: all
tasks:
- name: Ensure pip
include_role:
name: ensure-pip
- name: Copy manager script
copy:
src: github_manager.py
dest: "{{ ansible_user_dir }}"
- name: Install dependencies
pip:
name:
- PyGithub
- PyYAML
- requests
virtualenv: "{{ ansible_user_dir }}/.venv"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
- name: Run manager script
command: "{{ ansible_user_dir }}/.venv/bin/python {{ ansible_user_dir }}/github_manager.py {{ project_config }} {{ governance }}"
environment:
GITHUB_TOKEN: "{{ github_credentials.api_token }}"
- name: Clean up after ourselves
file:
path: "{{ item }}"
state: absent
with_items:
- github_manager.py
- .venv