From 0a1486a2c73275009f7158c911e7bfd683e40a58 Mon Sep 17 00:00:00 2001 From: SamYaple Date: Thu, 17 Mar 2016 17:50:23 +0000 Subject: [PATCH] Rework heka log copying Now that we have reconfigure we dont have to copy over all config files at the same time. TrivialFix Change-Id: I866be0f05e604151e081974a64f17bf65787f604 --- ansible/roles/common/tasks/config.yml | 63 ++++++++------------- ansible/roles/common/templates/heka.json.j2 | 3 +- 2 files changed, 27 insertions(+), 39 deletions(-) diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index 30e7a64007..c4d401ced1 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -19,45 +19,32 @@ - name: Copying over heka config files template: - src: "heka-{{ item }}.toml.j2" - dest: "{{ node_config_directory }}/heka/heka-{{ item }}.toml" + src: "heka-{{ item.src|default(item.name) }}.toml.j2" + dest: "{{ node_config_directory }}/heka/heka-{{ item.name }}.toml" + when: item.enabled | bool with_items: - - "global" - - "haproxy" - - "rabbitmq" - - "openstack" - - "mariadb" - - "keystone" - - "elasticsearch" - -- 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" - -- name: Copying over heka elasticsearch config file - template: - src: "heka-{{ item }}.toml.j2" - dest: "{{ node_config_directory }}/heka/heka-{{ item }}.toml" - with_items: - - "elasticsearch" - when: "{{ enable_central_logging | bool }}" + - { name: "elasticsearch", enabled: "{{ enable_central_logging }}" } + - { name: "global", enabled: "yes" } + - { name: "haproxy", enabled: "{{ enable_haproxy }}" } + - { name: "keystone", enabled: "{{ enable_keystone }}" } + - { name: "mariadb", enabled: "{{ enable_rabbitmq }}" } + - { name: "openstack", enabled: "yes" } + - { name: "rabbitmq", enabled: "{{ enable_rabbitmq }}" } + - { name: "swift-account-auditor", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-account-reaper", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-account-replicator", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-account-server", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-container-auditor", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-container-replicator", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-container-server", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-container-updater", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-object-auditor", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-object-expirer", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-object-replicator", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-object-server", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-object-updater", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-proxy-server", src: "swift", enabled: "{{ enable_swift }}" } + - { name: "swift-rsyncd", src: "swift", enabled: "{{ enable_swift }}" } - name: Copying over cron logrotate config files template: diff --git a/ansible/roles/common/templates/heka.json.j2 b/ansible/roles/common/templates/heka.json.j2 index 332790231e..857e5185b4 100644 --- a/ansible/roles/common/templates/heka.json.j2 +++ b/ansible/roles/common/templates/heka.json.j2 @@ -50,7 +50,8 @@ "source": "{{ container_config_directory }}/heka-{{ swift_service }}.toml", "dest": "/etc/heka/heka-{{ swift_service }}.toml", "owner": "heka", - "perm": "0600" + "perm": "0600", + "optional": "True" }{% if not loop.last %},{% endif %} {% endfor %}