remove unnecessary file
This commit is contained in:
parent
20220c92c7
commit
06b1d48ff4
1 changed files with 0 additions and 120 deletions
|
@ -1,120 +0,0 @@
|
|||
# This playbook syncs the production fas with staging and manages all
|
||||
# the steps we need to keep our setup intact.
|
||||
#
|
||||
|
||||
- name: bring staging services down (OpenShift web services)
|
||||
hosts: os-master01.stg.phx2.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:
|
||||
- command: oc -n fas scale dc/fas --replicas=0
|
||||
- command: oc -n fas scale dc/totpcgi --replicas=0
|
||||
- command: oc -n fas scale dc/yubikey --replicas=0
|
||||
|
||||
- name: dump the prod db out
|
||||
hosts: db-fas01.phx2.fedoraproject.org
|
||||
user: root
|
||||
become: yes
|
||||
become_user: postgres
|
||||
become_method: sudo
|
||||
|
||||
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:
|
||||
- name: Dumping the production db. This might take a minute. Go out to the lobby!
|
||||
shell: pg_dump -C fas2 |xz -c > /var/tmp/fas2.dump.xz
|
||||
#
|
||||
# pull dump from prod to batcave
|
||||
#
|
||||
- fetch:
|
||||
src: /var/tmp/fas2.dump.xz
|
||||
dest: /var/tmp/
|
||||
flat: yes
|
||||
|
||||
- name: drop and re-create the staging db entirely
|
||||
hosts: db-fas01.stg.phx2.fedoraproject.org
|
||||
user: root
|
||||
become: yes
|
||||
become_user: postgres
|
||||
become_method: sudo
|
||||
|
||||
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:
|
||||
#
|
||||
# push dump to stg from batcave
|
||||
#
|
||||
- copy:
|
||||
src: /var/tmp/fas2.dump.xz
|
||||
dest: /var/tmp/fas2.dump.xz
|
||||
|
||||
- command: unxz /var/tmp/fas2.dump.xz
|
||||
creates=/var/tmp/fas2.dump
|
||||
|
||||
- command: dropdb fas2
|
||||
- command: createdb fas2
|
||||
- name: Import the prod db. This will take quite a while. Go get a snack!
|
||||
shell: cat /var/tmp/fas2.dump | psql fas2
|
||||
- command: rm -f /var/tmp/fas2.dump /var/tmp/fas2.dump.xz
|
||||
|
||||
- name: bring staging services up (OpenShift web services)
|
||||
hosts: os-master01.stg.phx2.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:
|
||||
- command: oc -n fas scale dc/fas --replicas=5
|
||||
- command: oc -n fas scale dc/totpcgi --replicas=3
|
||||
- command: oc -n fas scale dc/yubikey --replicas=3
|
||||
|
||||
- name: Remove the prod db dump now that we are done
|
||||
hosts: db-fas01.phx2.fedoraproject.org
|
||||
user: root
|
||||
become: yes
|
||||
become_user: postgres
|
||||
become_method: sudo
|
||||
|
||||
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:
|
||||
- name: Remove the db dump on the prod server
|
||||
command: rm -f /var/tmp/fas2.dump.xz
|
||||
|
||||
- name: Remove the prod db dump on batcave
|
||||
hosts: batcave01.phx2.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
|
||||
handlers:
|
||||
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
||||
|
||||
tasks:
|
||||
#
|
||||
# delete tmp dump on batcave01
|
||||
#
|
||||
- command: rm -f /var/tmp/fas2.dump.xz
|
Loading…
Add table
Add a link
Reference in a new issue