blob: 837657afbf3a88c5f5cdbde37d5b3b6657d241f8 [file] [log] [blame]
{%- from "octavia/map.jinja" import api,manager with context %}
octavia_render_config:
test.show_notification:
- text: "Running octavia.upgrade.render_config"
{%- if api.get('enabled', False) %}
/etc/octavia/certificates/openssl.cnf:
file.managed:
- source: salt://octavia/files/{{ api.version }}/certificates/openssl.cnf
/etc/octavia/octavia_api.conf:
file.managed:
- source: salt://octavia/files/{{ api.version }}/octavia_api.conf
- template: jinja
{%- endif %}
{%- if manager.get('enabled', False) %}
{%- set ssh_dir = salt['file.dirname'](manager.ssh.private_key_file) %}
{%- set image_mine_data = salt['mine.get']('glance:client', 'glanceng.get_image_owner_id', 'pillar').values() %}
{%- set network_mine_data = salt['mine.get']('neutron:client', 'list_octavia_networks', 'pillar').values() %}
{%- set secgroup_mine_data = salt['mine.get']('neutron:client', 'list_octavia_mgmt_security_groups', 'pillar').values() %}
{%- if image_mine_data and network_mine_data and secgroup_mine_data %}
/etc/octavia/octavia_manager.conf:
file.managed:
- source: salt://octavia/files/{{ manager.version }}/octavia_manager.conf
- template: jinja
- context:
amp_image_owner_id: {{ image_mine_data|first }}
amp_boot_network_list: {{ (network_mine_data|first)['networks'][0]['id'] }}
amp_secgroup_list: {{ (secgroup_mine_data|first)['lb-mgmt-sec-grp']['id'] }}
{%- endif %}
{% set dhclient_conf_path = '/etc/octavia/dhcp/dhclient.conf' %}
{{ dhclient_conf_path }}:
file.managed:
- source: salt://octavia/files/{{ manager.version }}/dhcp/dhclient.conf
{%- endif %}