Remove old playbooks not removed from last cleanup

This commit is contained in:
Michael Scherer 2024-08-08 16:23:43 -04:00
parent 5f991c601a
commit 425277ffa4
No known key found for this signature in database
2 changed files with 0 additions and 253 deletions

View file

@ -1,111 +0,0 @@
# Push out any new badge stuff.
#
# Badge artists and badge developers should be pushing stuff to this repo:
#
# https://pagure.io/fedora-badges.git
#
# This playbook will take any new content from there and push it out onto our
# servers.
- name: get the badges repo happening from the batcave
hosts: batcave01.iad2.fedoraproject.org
user: root
gather_facts: False
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
vars:
upstream: "https://pagure.io/fedora-badges.git"
workingdir: /srv/web/infra/badges/
local_repo: /srv/git/badges
tasks:
- name: Make a tmp directory
tempfile:
state: directory
suffix: _badges_tempdir
register: tmp
- set_fact:
tempdir: "{{tmp.path}}"
- name: clone the local bare repo
git:
dest: "{{tempdir}}"
repo: "{{local_repo}}"
remote: origin
update: yes
- name: add pagure as a second remote
command: git remote add pagure {{upstream}}
args:
chdir: "{{tempdir}}"
- name: pull down changes from pagure
command: git pull pagure master
args:
chdir: "{{tempdir}}"
- name: push pagure changes back to the lockbox bare repo
command: git push origin master
args:
chdir: "{{tempdir}}"
- name: clean up that temporary {{tempdir}} dir
file:
dest: "{{tempdir}}"
state: absent
- name: fix the working dir repo to use the right location
command: git remote set-url origin {{local_repo}}
args:
chdir: "{{workingdir}}"
- name: and pull those commits from the bare repo to the working dir
command: git pull origin master
args:
chdir: "{{workingdir}}"
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
- name: copy new badge art over to the badges web nodes
hosts: badges_web:badges_web_stg
user: root
gather_facts: False
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
roles:
- badges/frontend
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
- name: copy any new badges rules over to the badges backend and restart it
hosts: badges_backend:badges_backend_stg
user: root
gather_facts: False
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
roles:
- badges/backend
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
- name: run /usr/local/bin/update_checkout.sh
hosts: badges_web
tasks:
- command: /usr/local/bin/update_checkout.sh

View file

@ -1,142 +0,0 @@
- name: push packages out to frontend
hosts: badges_web:badges_web_stg
user: root
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
vars:
testing: False
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
tasks:
- name: clean all metadata {%if testing%}(with infrastructure-testing on){%endif%}
command: yum clean all {%if testing%} --enablerepo=infrastructure-tags-stg {%endif%}
check_mode: no
- name: update tahrir/badges packages from main repo
package:
name:
- python-tahrir
- python-tahrir-api
state: latest
when: not testing
- name: update tahrir/badges packages from testing repo
yum:
name:
- python-tahrir
- python-tahrir-api
state: latest
enablerepo: infrastructure-tags-stg
when: testing
- name: push packages out to backend
hosts: badges_backend:badges_backend_stg
user: root
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
vars:
testing: False
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
tasks:
- name: clean all metadata {%if testing%}(with infrastructure-testing on){%endif%}
command: yum clean all {%if testing%} --enablerepo=infrastructure-tags-stg {%endif%}
check_mode: no
- name: update tahrir/badges packages from main repo
package:
name:
- python-fedbadges
- python-tahrir-api
state: latest
when: not testing
- name: update tahrir/badges packages from testing repo
yum:
name:
- python-fedbadges
- python-tahrir-api
state: latest
enablerepo: infrastructure-tags-stg
when: testing
- name: verify the frontend and stop it
hosts: badges_web:badges_web_stg
user: root
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
pre_tasks:
- name: tell nagios to shush w.r.t. the frontend
nagios: action=downtime minutes=15 service=host host={{ inventory_hostname_short }}{{ env_suffix }}
delegate_to: noc01.iad2.fedoraproject.org
ignore_errors: true
roles:
- badges/frontend
post_tasks:
- service: name="httpd" state=stopped
- name: verify the backend, stop it, and then upgrade the db
hosts: badges_backend:badges_backend_stg
user: root
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
pre_tasks:
- name: tell nagios to shush w.r.t. the backend
nagios: action=downtime minutes=15 service=host host={{ inventory_hostname_short }}{{ env_suffix }}
delegate_to: noc01.iad2.fedoraproject.org
ignore_errors: true
roles:
- badges/backend
tasks:
- name: Stop the badges backend
service: name="fedmsg-hub" state=stopped
- name: Upgrade the database
command: /usr/bin/alembic -c /usr/share/tahrir_api/alembic.ini upgrade head
args:
chdir: /usr/share/tahrir_api/
ignore_errors: true
- name: And... start the backend again
service: name="fedmsg-hub" state=started
post_tasks:
- name: tell nagios to unshush w.r.t. the backend
nagios: action=unsilence service=host host={{ inventory_hostname_short }}{{ env_suffix }}
delegate_to: noc01.iad2.fedoraproject.org
ignore_errors: true
- name: restart the frontend
hosts: badges_web:badges_web_stg
user: root
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
tasks:
- service: name="httpd" state=started
post_tasks:
- name: tell nagios to unshush w.r.t. the frontend
nagios: action=unsilence service=host host={{ inventory_hostname_short }}{{ env_suffix }}
delegate_to: noc01.iad2.fedoraproject.org
ignore_errors: true