From 31e2e85d8c2f6d3e1127967b8fed0a6a4e20532a Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jun 19 2019 00:22:10 +0000 Subject: openqa playbook: rearrange, drop queue 'when' conditionals This was kinda...a mess. I had just dumped the queue creation in the staging NFS client play for some reason, and it still had 'when' conditionals from when I only wanted the messaging stuff to happen on staging. This cleans all that up and creates separate plays for the queue creation and NFS client stuff. The plays should also be in the right *order* now, so we get the NFS mounts created and the AMQP queues set up *before* we run the roles. --- diff --git a/playbooks/groups/openqa.yml b/playbooks/groups/openqa.yml index 3597ab0..987cfe1 100644 --- a/playbooks/groups/openqa.yml +++ b/playbooks/groups/openqa.yml @@ -1,6 +1,6 @@ - import_playbook: "/srv/web/infra/ansible/playbooks/include/virt-create.yml myhosts=openqa:openqa_stg" -- name: setup base openqa host +- name: setup base openQA host hosts: openqa:openqa_stg user: root gather_facts: True @@ -32,7 +32,7 @@ handlers: - import_tasks: "{{ handlers_path }}/restart_services.yml" -- name: configure openQA +- name: configure fedora-messaging queues on openQA servers hosts: openqa:openqa_stg user: root gather_facts: True @@ -42,32 +42,7 @@ - "/srv/private/ansible/vars.yml" - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml -# relvalconsumer and autocloudreporter aren't particularly related -# to openQA in any way, we just put those role on these boxes. There's -# nowhere more obviously correct for rvc and acr should be on an -# Autocloud box but I don't know if they're authed for RDB. roles: - - { role: openqa/server, tags: ['openqa_server'] } - - { role: openqa/dispatcher, tags: ['openqa_dispatcher'] } - - { role: check-compose, tags: ['check-compose'] } - - { role: fedmsg/base, tags: ['fedmsg_base', 'fedmsg'] } - - { role: fedmsg/hub, tags: ['fedmsg_hub', 'fedmsg'] } - - { role: relvalconsumer, tags: ['relvalconsumer'] } - - { role: autocloudreporter, tags: ['autocloudreporter'] } - - handlers: - - import_tasks: "{{ handlers_path }}/restart_services.yml" - -- name: set up openQA server data NFS mounts (staging) - hosts: openqa_stg - - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - "/srv/private/ansible/vars.yml" - - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - - roles: - # fedora-messaging queue/user setup - role: rabbit/queue username: "openqa" queue_name: "openqa{{ openqa_env_suffix }}_scheduler" @@ -81,7 +56,6 @@ env: "production" env_suffix: "" tags: ['rabbit'] - when: deployment_type == "stg" - role: rabbit/queue username: "openqa{{ openqa_env_suffix }}" queue_name: "openqa{{ openqa_env_suffix }}_resultsdb_reporter" @@ -93,7 +67,6 @@ env: "{{ openqa_env }}" env_suffix: "{{ openqa_env_suffix }}" tags: ['rabbit'] - when: deployment_type == "stg" - role: rabbit/queue username: "openqa{{ openqa_env_suffix }}" queue_name: "openqa{{ openqa_env_suffix }}_wiki_reporter" @@ -105,7 +78,6 @@ env: "{{ openqa_env }}" env_suffix: "{{ openqa_env_suffix }}" tags: ['rabbit'] - when: deployment_type == "stg" # relvalconsumer queue, we still use openqa auth for this as it's # easy that way - role: rabbit/queue @@ -119,7 +91,16 @@ env: "production" env_suffix: "" tags: ['rabbit'] - # nfs client setup + +- name: set up openQA server data NFS mounts (staging) + hosts: openqa_stg + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + roles: - role: nfs/client mnt_dir: '/var/lib/openqa/testresults' nfs_src_dir: 'fedora_openqa_stg/testresults' @@ -156,3 +137,29 @@ handlers: - import_tasks: "{{ handlers_path }}/restart_services.yml" + +- name: configure openQA + hosts: openqa:openqa_stg + 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 + +# relvalconsumer and autocloudreporter aren't particularly related +# to openQA in any way, we just put those role on these boxes. There's +# nowhere more obviously correct for rvc and acr should be on an +# Autocloud box but I don't know if they're authed for RDB. + roles: + - { role: openqa/server, tags: ['openqa_server'] } + - { role: openqa/dispatcher, tags: ['openqa_dispatcher'] } + - { role: check-compose, tags: ['check-compose'] } + - { role: fedmsg/base, tags: ['fedmsg_base', 'fedmsg'] } + - { role: fedmsg/hub, tags: ['fedmsg_hub', 'fedmsg'] } + - { role: relvalconsumer, tags: ['relvalconsumer'] } + - { role: autocloudreporter, tags: ['autocloudreporter'] } + + handlers: + - import_tasks: "{{ handlers_path }}/restart_services.yml"