diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index 4a0705a7d9..268a3a613a 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -34,3 +34,24 @@ - "openstack" - "mariadb" - "keystone" + +- name: Copying over heka swift config files + template: + src: "heka-swift.toml.j2" + dest: "{{ node_config_directory }}/heka/heka-{{ item }}.toml" + with_items: + - "swift-account-auditor" + - "swift-account-reaper" + - "swift-account-replicator" + - "swift-account-server" + - "swift-container-auditor" + - "swift-container-replicator" + - "swift-container-server" + - "swift-container-updater" + - "swift-object-auditor" + - "swift-object-expirer" + - "swift-object-replicator" + - "swift-object-server" + - "swift-object-updater" + - "swift-proxy-server" + - "swift-rsyncd" diff --git a/ansible/roles/common/templates/heka-swift.toml.j2 b/ansible/roles/common/templates/heka-swift.toml.j2 new file mode 100644 index 0000000000..3bb520e322 --- /dev/null +++ b/ansible/roles/common/templates/heka-swift.toml.j2 @@ -0,0 +1,8 @@ +# Swift writes its logs to Syslog, so the generic Syslog input set in +# heka-global.toml.j2 is used. + +[{{ item }}_file_output] +type = "FileOutput" +message_matcher = "Type == 'Syslog' && Fields[programname] == '{{ item }}'" +path = "/var/log/kolla/swift/{{ item }}.log" +encoder = "syslog_encoder" diff --git a/ansible/roles/common/templates/heka.json.j2 b/ansible/roles/common/templates/heka.json.j2 index 69bfc084af..30ed998804 100644 --- a/ansible/roles/common/templates/heka.json.j2 +++ b/ansible/roles/common/templates/heka.json.j2 @@ -1,3 +1,4 @@ +{% set swift_services = ["swift-account-auditor", "swift-account-reaper", "swift-account-replicator", "swift-account-server", "swift-container-auditor", "swift-container-replicator", "swift-container-server", "swift-container-updater", "swift-object-auditor", "swift-object-expirer", "swift-object-replicator", "swift-object-server", "swift-object-updater", "swift-proxy-server", "swift-rsyncd"] %} { "command": "/usr/bin/hekad -config=/etc/heka/", "config_files": [ @@ -36,6 +37,16 @@ "dest": "/etc/heka/heka-keystone.toml", "owner": "heka", "perm": "0600" + }, +{% for swift_service in swift_services %} + { + "source": "{{ container_config_directory }}/heka-{{ swift_service }}.toml", + "dest": "/etc/heka/heka-{{ swift_service }}.toml", + "owner": "heka", + "perm": "0600" } +{%- if not loop.last %},{% endif %} +{% endfor %} + ] } diff --git a/ansible/roles/common/templates/rsyslog.conf.j2 b/ansible/roles/common/templates/rsyslog.conf.j2 index 0809115219..349861be47 100644 --- a/ansible/roles/common/templates/rsyslog.conf.j2 +++ b/ansible/roles/common/templates/rsyslog.conf.j2 @@ -28,54 +28,6 @@ $template CinderSchedulerFile,"/var/log/cinder/cinder-scheduler.log" $template CinderVolumeFile,"/var/log/cinder/cinder-volume.log" :syslogtag,contains,"cinder-volume" ?CinderVolumeFile -$template SwiftAccountFile,"/var/log/swift/swift-account-server.log" -:syslogtag,contains,"swift-account-server" ?SwiftAccountFile - -$template SwiftAccountAuditorFile,"/var/log/swift/swift-account-auditor.log" -:syslogtag,contains,"swift-account-auditor" ?SwiftAccountAuditorFile - -$template SwiftAccountServerFile,"/var/log/swift/swift-account-server.log" -:syslogtag,contains,"swift-account-server" ?SwiftAccountServerFile - -$template SwiftContainerReplicatorFile,"/var/log/swift/swift-container-replicator.log" -:syslogtag,contains,"swift-container-replicator" ?SwiftContainerReplicatorFile - -$template SwiftObjectAuditorFile,"/var/log/swift/swift-object-auditor.log" -:syslogtag,contains,"swift-object-auditor" ?SwiftObjectAuditorFile - -$template SwiftObjectReplicatorFile,"/var/log/swift/swift-object-replicator.log" -:syslogtag,contains,"swift-object-replicator" ?SwiftObjectReplicatorFile - -$template SwiftProxyServerFile,"/var/log/swift/swift-proxy-server.log" -:syslogtag,contains,"swift-proxy-server" ?SwiftProxyServerFile - -$template SwiftAccountReaperFile,"/var/log/swift/swift-account-reaper.log" -:syslogtag,contains,"swift-account-reaper" ?SwiftAccountReaperFile - -$template SwiftContainerServerFile,"/var/log/swift/swift-container-server.log" -:syslogtag,contains,"swift-container-server" ?SwiftContainerServerFile - -$template SwiftObjectServerFile,"/var/log/swift/swift-object-server.log" -:syslogtag,contains,"swift-object-server" ?SwiftObjectServerFile - -$template SwiftRsyncdFile,"/var/log/swift/swift-rsyncd.log" -:syslogtag,contains,"swift-rsyncd" ?SwiftRsyncdFile - -$template SwiftAccountReplicatorFile,"/var/log/swift/swift-account-replicator.log" -:syslogtag,contains,"swift-account-replicator" ?SwiftAccountReplicatorFile - -$template SwiftContainerAuditorFile,"/var/log/swift/swift-container-auditor.log" -:syslogtag,contains,"swift-container-auditor" ?SwiftContainerAuditorFile - -$template SwiftContainerUpdaterFile,"/var/log/swift/swift-container-updater.log" -:syslogtag,contains,"swift-container-updater" ?SwiftContainerUpdaterFile - -$template SwiftObjectExpirerFile,"/var/log/swift/swift-object-expirer.log" -:syslogtag,contains,"swift-object-expirer" ?SwiftObjectExpirerFile - -$template SwiftObjectUpdaterFile,"/var/log/swift/swift-object-updater.log" -:syslogtag,contains,"swift-object-updater" ?SwiftObjectUpdaterFile - $template MuranoEngineFile,"/var/log/murano/murano-engine.log" :syslogtag,contains,"murano-engine" ?MuranoEngineFile diff --git a/ansible/roles/swift/tasks/start.yml b/ansible/roles/swift/tasks/start.yml index 11cb8eb11d..a1abdcae55 100644 --- a/ansible/roles/swift/tasks/start.yml +++ b/ansible/roles/swift/tasks/start.yml @@ -40,7 +40,7 @@ volumes: - "{{ node_config_directory }}/swift-rsyncd/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname not in groups['swift-proxy-server'] - name: Starting swift-proxy-server container @@ -52,7 +52,7 @@ volumes: - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-proxy-server/:{{ container_config_directory }}/:ro" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-proxy-server'] - name: Starting swift-account-server container @@ -65,7 +65,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-account-server/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-account-server'] - name: Starting swift-account-auditor container @@ -78,7 +78,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-account-auditor/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-account-server'] - name: Starting swift-account-replicator container @@ -91,7 +91,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-account-replicator/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-account-server'] - name: Starting swift-account-reaper container @@ -104,7 +104,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-account-reaper/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-account-server'] - name: Starting swift-container-server container @@ -117,7 +117,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-container-server/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-container-server'] - name: Starting swift-container-auditor container @@ -130,7 +130,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-container-auditor/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-container-server'] - name: Starting swift-container-replicator container @@ -143,7 +143,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-container-replicator/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-container-server'] - name: Starting swift-container-updater container @@ -156,7 +156,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-container-updater/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-container-server'] - name: Starting swift-object-server container @@ -169,7 +169,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-object-server/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-object-server'] - name: Starting swift-object-auditor container @@ -182,7 +182,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-object-auditor/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-object-server'] - name: Starting swift-object-replicator container @@ -195,7 +195,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-object-replicator/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-object-server'] - name: Starting swift-object-updater container @@ -208,7 +208,7 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-object-updater/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-object-server'] - name: Starting swift-object-expirer container @@ -221,5 +221,5 @@ - "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro" - "{{ node_config_directory }}/swift-object-expirer/:{{ container_config_directory }}/:ro" - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}" - - "rsyslog_socket:/var/lib/kolla/rsyslog/" + - "heka_socket:/var/lib/kolla/heka/" when: inventory_hostname in groups['swift-object-server'] diff --git a/ansible/roles/swift/templates/account.conf.j2 b/ansible/roles/swift/templates/account.conf.j2 index 782a6acd10..d3c2f26441 100644 --- a/ansible/roles/swift/templates/account.conf.j2 +++ b/ansible/roles/swift/templates/account.conf.j2 @@ -3,6 +3,7 @@ bind_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['a bind_port = {{ swift_account_server_port }} devices = {{ swift_devices_mount_point }} mount_check = false +log_address = /var/lib/kolla/heka/log log_name = {{ service_name }} log_facility = LOG_LOCAL0 log_level = warning diff --git a/ansible/roles/swift/templates/container.conf.j2 b/ansible/roles/swift/templates/container.conf.j2 index ceffe5bf22..879dd9c3c9 100644 --- a/ansible/roles/swift/templates/container.conf.j2 +++ b/ansible/roles/swift/templates/container.conf.j2 @@ -3,6 +3,7 @@ bind_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['a bind_port = {{ swift_container_server_port }} devices = {{ swift_devices_mount_point }} mount_check = false +log_address = /var/lib/kolla/heka/log log_name = {{ service_name }} log_facility = LOG_LOCAL0 log_level = warning diff --git a/ansible/roles/swift/templates/object.conf.j2 b/ansible/roles/swift/templates/object.conf.j2 index f4eef56c6b..b3856228cf 100644 --- a/ansible/roles/swift/templates/object.conf.j2 +++ b/ansible/roles/swift/templates/object.conf.j2 @@ -4,6 +4,7 @@ bind_port = {{ swift_object_server_port }} devices = {{ swift_devices_mount_point }} mount_check = false +log_address = /var/lib/kolla/heka/log log_name = {{ service_name }} log_facility = LOG_LOCAL0 log_level = warning diff --git a/ansible/roles/swift/templates/proxy-server.conf.j2 b/ansible/roles/swift/templates/proxy-server.conf.j2 index 71a15c8a7f..e8ea502e26 100644 --- a/ansible/roles/swift/templates/proxy-server.conf.j2 +++ b/ansible/roles/swift/templates/proxy-server.conf.j2 @@ -2,6 +2,7 @@ bind_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} bind_port = {{ swift_proxy_server_port }} +log_address = /var/lib/kolla/heka/log log_name = {{ service_name }} log_facility = LOG_LOCAL0 log_level = warning