kayobe/ansible/swift-rings.yml
Pierre Riteau 1419636930 Support multiple environments from a single configuration
Change-Id: I848d834aa36943027c126e26e93e4a4680521144
Story: 2002009
Task: 40037
2021-03-31 17:01:35 +02:00

36 lines
1.3 KiB
YAML

---
- name: Ensure swift ring files exist
hosts: localhost
tags:
- swift
- swift-rings
tasks:
- name: Initialise a fact about swift hosts
set_fact:
swift_host_config: []
- name: Update a fact about Swift hosts
set_fact:
swift_host_config: "{{ swift_host_config + [swift_host] }}"
vars:
swift_host:
host: "{{ host }}"
region: "{{ hostvars[host]['swift_region'] }}"
zone: "{{ hostvars[host]['swift_zone'] }}"
ip: "{{ swift_storage_net_name | net_ip(inventory_hostname=host) }}"
ports: "{{ hostvars[host]['swift_service_ports'] }}"
replication_ip: "{{ swift_storage_replication_net_name | net_ip(inventory_hostname=host) }}"
replication_ports: "{{ hostvars[host]['swift_service_ports'] }}"
block_devices: "{{ hostvars[host]['swift_block_devices'] }}"
block_device_default_services: "{{ hostvars[host]['swift_block_device_default_services'] }}"
block_device_default_weight: "{{ hostvars[host]['swift_block_device_default_weight'] }}"
with_inventory_hostnames: "{{ swift_hosts }}"
loop_control:
loop_var: host
- include_role:
name: swift-rings
vars:
swift_config_path: "{{ kayobe_env_config_path }}/kolla/config/swift"
when: kolla_enable_swift | bool