Merge "Define condition for the first play host one time"

This commit is contained in:
Zuul 2020-12-03 13:39:11 +00:00 committed by Gerrit Code Review
commit 8a4c92ee7e
2 changed files with 5 additions and 3 deletions

View File

@ -28,7 +28,7 @@
- always
- import_tasks: db_setup.yml
when: inventory_hostname == groups['adjutant_all'][0]
when: _adjutant_is_first_play_host
vars:
_oslodb_setup_host: "{{ adjutant_galera_setup_host }}"
_oslodb_ansible_python_interpreter: "{{ adjutant_galera_setup_python_interpreter }}"
@ -70,7 +70,7 @@
- adjutant-config
- import_tasks: adjutant_db_sync.yml
when: inventory_hostname == groups['adjutant_all'][0]
when: _adjutant_is_first_play_host
tags:
- adjutant-config
@ -102,7 +102,7 @@
- interface: "admin"
url: "{{ adjutant_service_adminurl }}"
service: "{{ adjutant_service_name }}"
when: inventory_hostname == groups['adjutant_all'][0]
when: _adjutant_is_first_play_host
tags:
- adjutant-config

View File

@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
_adjutant_is_first_play_host: "{{ (adjutant_services['adjutant-api']['group'] in group_names and inventory_hostname == (groups[adjutant_services['adjutant-api']['group']] | intersect(ansible_play_hosts)) | first) | bool }}"
filtered_adjutant_services: |-
{% set services = [] %}
{% for key, value in adjutant_services.items() %}