From f258376a889c85039f0183e173f4e3a9f6a69a59 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sat, 23 May 2020 15:07:15 +0200 Subject: [PATCH] distgit: restructure the playbook so it does the basic first then the dist-git specific bits This will hopefully help making sure, for example, the correct rhel8.repo repo definition file gets installed before we call the pagure role that relies on this file being there. Signed-off-by: Pierre-Yves Chibon --- playbooks/groups/pkgs.yml | 58 ++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/playbooks/groups/pkgs.yml b/playbooks/groups/pkgs.yml index 300552805f..9766395845 100644 --- a/playbooks/groups/pkgs.yml +++ b/playbooks/groups/pkgs.yml @@ -19,27 +19,6 @@ - collectd/base - sudo - apache - - { role: gitolite/base, when: env != "staging" } - - gitolite/check_fedmsg_hooks - - { role: git/make_checkout_seed, when: env != "staging" } - - git/hooks - - git/checks - - clamav - - { role: nfs/client, - when: env != "staging", - mnt_dir: '/srv/cache/lookaside', - nfs_src_dir: 'fedora_sourcecache', nfs_mount_opts='rw,hard,bg,intr,noatime,nodev,nosuid,sec=sys,nfsvers=3' } - - { role: nfs/client, - when: env == "staging" and inventory_hostname.startswith('pkgs01'), - mnt_dir: '/srv/cache/lookaside_prod', - nfs_src_dir: 'fedora_sourcecache', nfs_mount_opts='ro,hard,bg,intr,noatime,nodev,nosuid,sec=sys,nfsvers=3' } - - role: distgit/pagure - - role: distgit - tags: distgit - - { role: hosts, when: env == "staging" } - # Set up for fedora-messaging - - role: rabbit/user - username: "pagure{{ env_suffix }}" tasks: - name: Copy keytab @@ -71,7 +50,42 @@ comment: "Pagure User" when: env == "staging" ## The above should be deleted when we rebuild pkgs02 in future. - + +- name: setup dist-git on the box + hosts: pkgs_stg:pkgs02.phx2.fedoraproject.org + user: root + gather_facts: True + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + roles: + - { role: gitolite/base, when: env != "staging" } + - gitolite/check_fedmsg_hooks + - { role: git/make_checkout_seed, when: env != "staging" } + - git/hooks + - git/checks + - clamav + - { role: nfs/client, + when: env != "staging", + mnt_dir: '/srv/cache/lookaside', + nfs_src_dir: 'fedora_sourcecache', nfs_mount_opts='rw,hard,bg,intr,noatime,nodev,nosuid,sec=sys,nfsvers=3' } + - { role: nfs/client, + when: env == "staging" and inventory_hostname.startswith('pkgs01'), + mnt_dir: '/srv/cache/lookaside_prod', + nfs_src_dir: 'fedora_sourcecache', nfs_mount_opts='ro,hard,bg,intr,noatime,nodev,nosuid,sec=sys,nfsvers=3' } + - role: distgit/pagure + - role: distgit + tags: distgit + - { role: hosts, when: env == "staging" } + # Set up for fedora-messaging + - role: rabbit/user + username: "pagure{{ env_suffix }}" + + handlers: + - import_tasks: "{{ handlers_path }}/restart_services.yml" - name: setup fedmsg on pkgs hosts: pkgs02.phx2.fedoraproject.org