Browse Source

Merge "Add support for Octavia amphora log offloading" into stable/train

changes/68/735568/1
Zuul 3 weeks ago
committed by Gerrit Code Review
parent
commit
34b8fccd19
4 changed files with 71 additions and 0 deletions
  1. +1
    -0
      tripleo_ansible/playbooks/octavia-files.yaml
  2. +55
    -0
      tripleo_ansible/roles/octavia-controller-post-config/tasks/main.yml
  3. +1
    -0
      tripleo_ansible/roles/octavia_common/defaults/main.yml
  4. +14
    -0
      tripleo_ansible/roles/octavia_controller_post_config/templates/10-octavia.conf.j2

+ 1
- 0
tripleo_ansible/playbooks/octavia-files.yaml View File

@@ -95,5 +95,6 @@
vars:
octavia_confd_prefix: "/var/lib/config-data/puppet-generated/octavia"
container_cli: "{{ container_cli }}"
enable_log_offloading: "{{ enable_log_offloading }}"
roles:
- octavia-controller-post-config

+ 55
- 0
tripleo_ansible/roles/octavia-controller-post-config/tasks/main.yml View File

@@ -14,6 +14,35 @@
set_fact:
o_hm_ip_list: "{{ o_hm_ip_list[:-2] }}"

- name: configure amphora log offloading
block:
- name: create ip list (rsyslog)
set_fact:
o_rsyslog_ip_list: "{% for octavia_node in groups['octavia_nodes'] %}{{ hostvars[octavia_node].mgmt_port_ip }}:514, {%endfor%}"

- name: create ip list (remove the last two characters) (rsyslog)
set_fact:
o_rsyslog_ip_list: "{{ o_rsyslog_ip_list[:-2] }}"

- name: create /etc/rsyslog.d
become: true
become_user: root
file:
state: directory
path: "{{ octavia_confd_prefix }}/etc/rsyslog.d"
selevel: s0
setype: svirt_sandbox_file_t

- name: create rsyslog 10-octavia.conf
become: true
become_user: root
template:
src: templates/10-octavia.conf.j2
dest: "{{ octavia_confd_prefix }}/etc/rsyslog.d/10-octavia.conf"
selevel: s0
setype: svirt_sandbox_file_t
when: enable_log_offloading | bool

- name: read the current IP list
become: true
become_user: root
@@ -48,6 +77,32 @@
when:
- octavia_config_updated

- name: setting [amphora_agent]/tenant_log_targets
become: true
become_user: root
ini_file:
section: "amphora_agent"
option: "tenant_log_targets"
value: "{{ o_rsyslog_ip_list }}"
path: "{{ octavia_confd_prefix }}/etc/octavia/post-deploy.conf"
selevel: s0
setype: svirt_sandbox_file_t
when:
- enable_log_offloading | bool

- name: setting [amphora_agent]/admin_log_targets
become: true
become_user: root
ini_file:
section: "amphora_agent"
option: "admin_log_targets"
value: "{{ o_rsyslog_ip_list }}"
path: "{{ octavia_confd_prefix }}/etc/octavia/post-deploy.conf"
selevel: s0
setype: svirt_sandbox_file_t
when:
- enable_log_offloading | bool

- name: get list of running octavia services
become: true
become_user: root


+ 1
- 0
tripleo_ansible/roles/octavia_common/defaults/main.yml View File

@@ -17,3 +17,4 @@ lb_mgmt_subnet_pool_end: "172.24.255.254"
lb_mgmt_sec_grp_name: "lb-mgmt-sec-grp"
lb_health_mgr_sec_grp_name: "lb-health-mgr-sec-grp"
mgmt_port_dev: "o-hm0"
enable_log_offloading: false

+ 14
- 0
tripleo_ansible/roles/octavia_controller_post_config/templates/10-octavia.conf.j2 View File

@@ -0,0 +1,14 @@
module(load="imudp")
input(type="imudp" address="{{ mgmt_port_ip }}" port="514")

# Output the amphora tenant traffic flow logs
if ($inputname == "imudp" and $syslogfacility-text == "local0" and $syslogseverity-text == "info" and $hostname startswith "amphora") then {
action(type="omfile" FileCreateMode="0644" File="/var/log/octavia/octavia-tenant-traffic.log")
stop
}

# Output the amphora administrative logs
if ($inputname == "imudp" and $syslogfacility-text == "local1" and $hostname startswith "amphora") then {
action(type="omfile" FileCreateMode="0644" File="/var/log/octavia/octavia-amphora.log")
stop
}

Loading…
Cancel
Save