diff --git a/playbooks/groups/koji-hub.yml b/playbooks/groups/koji-hub.yml index 4f4324ba1b..b021eefddf 100644 --- a/playbooks/groups/koji-hub.yml +++ b/playbooks/groups/koji-hub.yml @@ -79,14 +79,6 @@ - sudo tasks: - - name: create secondary volume dir for stg koji - file: dest=/mnt/koji/vol state=directory owner=apache group=apache mode=0755 - tags: koji_hub - when: env == 'staging' - - name: create symlink for stg/prod secondary volume - file: src=/mnt/fedora_koji_prod/koji dest=/mnt/koji/vol/prod state=link - tags: koji_hub - when: env == 'staging' - import_tasks: "{{ tasks_path }}/yumrepos.yml" - import_tasks: "{{ tasks_path }}/2fa_client.yml" - import_tasks: "{{ tasks_path }}/motd.yml" diff --git a/playbooks/manual/staging-sync/koji.yml b/playbooks/manual/staging-sync/koji.yml index f865ecdbee..4d1e3c53c6 100644 --- a/playbooks/manual/staging-sync/koji.yml +++ b/playbooks/manual/staging-sync/koji.yml @@ -81,15 +81,6 @@ - name: vacuum database shell: psql koji <<<"VACUUM ANALYZE" -# TODO -- nuke old staging content in /mnt/fedora_koji/koji/ -# TODO recreate directories under /mnt/fedora_koji/koji/ -# cd /mnt/fedora_koji/koji -# mkdir compose packages repos repos-dist scratch vol work -# chown apache:apache * -# chcon unconfined_u:object_r:httpd_sys_rw_content_t:s0 * -# ln -s /mnt/fedora_koji_prod/koji vol/prod -# TODO recreate directories under /mnt/koji/compose that composer expects to exist - - name: bring staging services up hosts: koji-stg user: root @@ -99,10 +90,33 @@ - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml handlers: - import_tasks: "{{ handlers_path }}/restart_services.yml" + tags: + - wipe-fs tasks: - - service: name=httpd state=started - - service: name=kojira state=started + - name: unmount koji filesystem + mount: name=/mnt/fedora_koji state=unmounted + - name: wipe fedora_koji volume + filesystem: dev=/dev/GuestVolGroup00/fedora_koji fstype=xfs force=yes + - name: mount newly-created empty koji filesystem + mount: name=/mnt/fedora_koji src=/dev/GuestVolGroup00/fedora_koji fstype=xfs state=mounted + - name: recreate koji directory structure + file: name={{item}} state=directory owner=apache group=apache setype=httpd_sys_rw_content_t + with_items: + - /mnt/koji/compose + - /mnt/koji/packages + - /mnt/koji/repos + - /mnt/koji/repos-dist + - /mnt/koji/scratch + - /mnt/koji/vol + - /mnt/koji/work +# TODO recreate directories under /mnt/koji/compose (which ones?) that composer expects to exist + - name: symlink production volume + file: src=/mnt/fedora_koji_prod/koji dest=/mnt/koji/vol/prod state=link + - name: restart httpd + service: name=httpd state=started + - name: restart kojira + service: name=kojira state=started # TODO remount NFS on builders, composers, bodhi and odcs # ansible -i /srv/web/infra/ansible/inventory/builders builders-stg:releng-stg:bodhi-backend-stg:odcs-backend-stg -m shell -a "umount /mnt/fedora_koji && mount /mnt/fedora_koji"