ansible/playbooks/manual/import-irc-cookies-to-matrix.yml
Ryan Lerch 462176464b ansiblelint fixes-- fqcn[action-core] - command to ansible.builtin.command
Replaces many references to  command: with ansible.builtin.command

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 11:26:47 +10:00

41 lines
1.3 KiB
YAML

# This playbook imports the cookies given on IRC to the Matrix Zodbot
---
- name: Import the cookies
hosts: value02.iad2.fedoraproject.org:value02.stg.iad2.fedoraproject.org
user: root
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
tasks:
- name: Add the pgpass file
ansible.builtin.copy:
content: |
db01{{ env_suffix }}.iad2.fedoraproject.org:*:maubot:maubot:{{ (env == 'production')|ternary(maubot_prod_db_password, maubot_stg_db_password) }}
dest: /root/.pgpass
owner: root
group: root
mode: "0400"
- name: Install the required package
dnf:
state: installed
name: python3-psycopg2
- name: Install the import script
ansible.builtin.copy:
src: "{{ files }}/zodbot/karma-to-cookies-db.py"
dest: /usr/local/bin/karma-to-cookies-db
mode: "0755"
- name: Run the import script
ansible.builtin.command:
argv:
- /usr/local/bin/karma-to-cookies-db
- -i
- zodbot{% if env == "staging" %}-stg{% endif %}-fedora
- /var/lib/{{ (env == 'production')|ternary('zodbot', 'ursabot') }}/data/karma.db