Support Octavia custom policy
Change-Id: I542b06be75991412f8e2a931ea2e40f0a0c317e4 Closes-Bug: #1758903
This commit is contained in:
parent
476bf15c1c
commit
22bf7997b9
@ -5,6 +5,7 @@
|
||||
service: "{{ octavia_services[service_name] }}"
|
||||
config_json: "{{ octavia_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
octavia_conf: "{{ octavia_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
policy_overwriting: "{{ octavia_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
octavia_api_container: "{{ check_octavia_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
become: true
|
||||
kolla_docker:
|
||||
@ -20,6 +21,7 @@
|
||||
- service.enabled | bool
|
||||
- config_json.changed | bool
|
||||
or octavia_conf.changed | bool
|
||||
or policy_overwriting.changed | bool
|
||||
or octavia_api_container.changed | bool
|
||||
|
||||
- name: Restart octavia-health-manager container
|
||||
@ -28,6 +30,7 @@
|
||||
service: "{{ octavia_services[service_name] }}"
|
||||
config_json: "{{ octavia_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
octavia_conf: "{{ octavia_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
policy_overwriting: "{{ octavia_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
octavia_health_manager_container: "{{ check_octavia_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
become: true
|
||||
kolla_docker:
|
||||
@ -43,6 +46,7 @@
|
||||
- service.enabled | bool
|
||||
- config_json.changed | bool
|
||||
or octavia_conf.changed | bool
|
||||
or policy_overwriting.changed | bool
|
||||
or octavia_health_manager_certificate.changed | bool
|
||||
or octavia_health_manager_container.changed | bool
|
||||
|
||||
@ -52,6 +56,7 @@
|
||||
service: "{{ octavia_services[service_name] }}"
|
||||
config_json: "{{ octavia_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
octavia_conf: "{{ octavia_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
policy_overwriting: "{{ octavia_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
octavia_housekeeping_container: "{{ check_octavia_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
become: true
|
||||
kolla_docker:
|
||||
@ -67,6 +72,7 @@
|
||||
- service.enabled | bool
|
||||
- config_json.changed | bool
|
||||
or octavia_conf.changed | bool
|
||||
or policy_overwriting.changed | bool
|
||||
or octavia_housekeeping_certificate.changed | bool
|
||||
or octavia_housekeeping_container.changed | bool
|
||||
|
||||
@ -76,6 +82,7 @@
|
||||
service: "{{ octavia_services[service_name] }}"
|
||||
config_json: "{{ octavia_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
octavia_conf: "{{ octavia_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
policy_overwriting: "{{ octavia_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
octavia_worker_container: "{{ check_octavia_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||
become: true
|
||||
kolla_docker:
|
||||
@ -91,5 +98,6 @@
|
||||
- service.enabled | bool
|
||||
- config_json.changed | bool
|
||||
or octavia_conf.changed | bool
|
||||
or policy_overwriting.changed | bool
|
||||
or octavia_worker_certificate.changed | bool
|
||||
or octavia_worker_container.changed | bool
|
||||
|
@ -12,6 +12,38 @@
|
||||
- item.value.enabled | bool
|
||||
with_dict: "{{ octavia_services }}"
|
||||
|
||||
- name: Check if policies shall be overwritten
|
||||
local_action: stat path="{{ item }}"
|
||||
run_once: True
|
||||
register: octavia_policy
|
||||
with_first_found:
|
||||
- files: "{{ supported_policy_format_list }}"
|
||||
paths:
|
||||
- "{{ node_custom_config }}/octavia/"
|
||||
skip: true
|
||||
|
||||
- name: Set octavia policy file
|
||||
set_fact:
|
||||
octavia_policy_file: "{{ octavia_policy.results.0.stat.path | basename }}"
|
||||
octavia_policy_file_path: "{{ octavia_policy.results.0.stat.path }}"
|
||||
when:
|
||||
- octavia_policy.results
|
||||
|
||||
- name: Copying over existing policy file
|
||||
template:
|
||||
src: "{{ octavia_policy_file_path }}"
|
||||
dest: "{{ node_config_directory }}/{{ item.key }}/{{ octavia_policy_file }}"
|
||||
mode: "0660"
|
||||
become: true
|
||||
register: octavia_policy_overwriting
|
||||
when:
|
||||
- octavia_policy_file is defined
|
||||
- inventory_hostname in groups[item.value.group]
|
||||
- item.value.enabled | bool
|
||||
with_dict: "{{ octavia_services }}"
|
||||
notify:
|
||||
- "Restart {{ item.key }} container"
|
||||
|
||||
- name: Copying over config.json files for services
|
||||
template:
|
||||
src: "{{ item.key }}.json.j2"
|
||||
|
@ -6,6 +6,12 @@
|
||||
"dest": "/etc/octavia/octavia.conf",
|
||||
"owner": "octavia",
|
||||
"perm": "0600"
|
||||
}
|
||||
}{% if octavia_policy_file is defined %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/{{ octavia_policy_file }}",
|
||||
"dest": "/etc/octavia/{{ octavia_policy_file }}",
|
||||
"owner": "octavia",
|
||||
"perm": "0600"
|
||||
}{% endif %}
|
||||
]
|
||||
}
|
||||
|
@ -74,3 +74,8 @@ rpc_thread_pool_size = 2
|
||||
|
||||
[oslo_messaging_notifications]
|
||||
transport_url = {{ notify_transport_url }}
|
||||
|
||||
{% if octavia_policy_file is defined %}
|
||||
[oslo_policy]
|
||||
policy_file = {{ octavia_policy_file }}
|
||||
{% endif %}
|
||||
|
@ -0,0 +1,3 @@
|
||||
---
|
||||
features:
|
||||
- Add support Octavia custom policy.
|
Loading…
Reference in New Issue
Block a user