diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index e261f83ee5..c65c9e8588 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -1,8 +1,10 @@ --- - include: "{{ action }}.yml" + tags: common when: not common_run - name: Registering common role has run set_fact: common_run: True + tags: common when: not common_run diff --git a/ansible/site.yml b/ansible/site.yml index 526303236d..dbe0f757cc 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -1,10 +1,17 @@ --- -- hosts: +# NOTE(awiddersheim): Gather facts for all hosts as a +# first step since several plays below require them when +# building their configurations. The below 'gather_facts' +# set to 'false' is a bit confusing but this is to avoid +# Ansible gathering facts twice. +- name: Gather facts for all hosts + hosts: - all serial: '{{ serial|default("0") }}' - roles: - - { role: common, - tags: common } + gather_facts: false + tasks: + - setup: + tags: always - hosts: - ceph-mon @@ -45,7 +52,8 @@ tags: telegraf, when: enable_telegraf | bool } -- hosts: haproxy +- hosts: + - haproxy roles: - { role: haproxy, tags: haproxy,