aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-22 08:16:24 +0000
committerGerrit Code Review <review@openstack.org>2016-09-22 08:16:24 +0000
commitf0d8b1293075dcfd41a0506ae4e1b3cf0a780a13 (patch)
tree60afffc8b3a2094956754a4e38f3a54b546ebce6
parentea7b268242b58080134aa8e0bea4d53861a25418 (diff)
parent3bd180f857bdab8edf1ea0c98934eb817df22f73 (diff)
downloadkolla-f0d8b1293075dcfd41a0506ae4e1b3cf0a780a13.tar.gz
kolla-f0d8b1293075dcfd41a0506ae4e1b3cf0a780a13.zip
Merge "Only enabled services log files"
-rw-r--r--ansible/roles/common/tasks/config.yml51
-rw-r--r--ansible/roles/common/templates/cron.json.j246
2 files changed, 49 insertions, 48 deletions
diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml
index f28aced81..426760502 100644
--- a/ansible/roles/common/tasks/config.yml
+++ b/ansible/roles/common/tasks/config.yml
@@ -65,29 +65,30 @@
- name: Copying over cron logrotate config files
template:
- src: "cron-logrotate-{{ item }}.conf.j2"
- dest: "{{ node_config_directory }}/cron/logrotate/{{ item }}.conf"
+ src: "cron-logrotate-{{ item.name }}.conf.j2"
+ dest: "{{ node_config_directory }}/cron/logrotate/{{ item.name }}.conf"
+ when: item.enabled | bool
with_items:
- - "ansible"
- - "aodh"
- - "barbican"
- - "cinder"
- - "cloudkitty"
- - "glance"
- - "global"
- - "gnocchi"
- - "haproxy"
- - "heat"
- - "keepalived"
- - "keystone"
- - "magnum"
- - "manila"
- - "mariadb"
- - "mistral"
- - "murano"
- - "neutron"
- - "nova"
- - "rabbitmq"
- - "senlin"
- - "swift"
- - "watcher"
+ - { name: "ansible", enabled: "yes" }
+ - { name: "aodh", enabled: "{{ enable_aodh }}" }
+ - { name: "barbican", enabled: "{{ enable_barbican }}" }
+ - { name: "cinder", enabled: "{{ enable_cinder }}" }
+ - { name: "cloudkitty", enabled: "{{ enable_cloudkitty }}" }
+ - { name: "glance", enabled: "{{ enable_glance }}" }
+ - { name: "global", enabled: "yes" }
+ - { name: "gnocchi", enabled: "{{ enable_gnocchi }}" }
+ - { name: "haproxy", enabled: "{{ enable_haproxy }}" }
+ - { name: "heat", enabled: "{{ enable_heat }}" }
+ - { name: "keepalived", enabled: "{{ enable_haproxy }}" }
+ - { name: "keystone", enabled: "{{ enable_keystone }}" }
+ - { name: "magnum", enabled: "{{ enable_magnum }}" }
+ - { name: "manila", enabled: "{{ enable_manila }}" }
+ - { name: "mariadb", enabled: "{{ enable_mariadb }}" }
+ - { name: "mistral", enabled: "{{ enable_mistral }}" }
+ - { name: "murano", enabled: "{{ enable_murano }}" }
+ - { name: "neutron", enabled: "{{ enable_neutron }}" }
+ - { name: "nova", enabled: "{{ enable_nova }}" }
+ - { name: "rabbitmq", enabled: "{{ enable_rabbitmq }}" }
+ - { name: "senlin", enabled: "{{ enable_senlin }}" }
+ - { name: "swift", enabled: "{{ enable_swift }}" }
+ - { name: "watcher", enabled: "{{ enable_watcher }}" }
diff --git a/ansible/roles/common/templates/cron.json.j2 b/ansible/roles/common/templates/cron.json.j2
index 26b8a47eb..85d0a1a4f 100644
--- a/ansible/roles/common/templates/cron.json.j2
+++ b/ansible/roles/common/templates/cron.json.j2
@@ -1,26 +1,26 @@
{% set cron_cmd = 'cron -f' if kolla_base_distro in ['ubuntu', 'debian'] else 'crond -s -n' %}
{% set services = [
- "ansible",
- "aodh",
- "barbican",
- "cinder",
- "cloudkitty",
- "glance",
- "gnocchi",
- "haproxy",
- "heat",
- "keepalived",
- "keystone",
- "magnum",
- "manila",
- "mariadb",
- "mistral",
- "murano",
- "neutron",
- "nova",
- "rabbitmq",
- "senlin",
- "swift"
+ ( 'ansible', 'yes' ),
+ ( 'aodh', enable_aodh ),
+ ( 'barbican', enable_barbican ),
+ ( 'cinder', enable_cinder ),
+ ( 'cloudkitty', enable_cloudkitty ),
+ ( 'glance', enable_glance ),
+ ( 'gnocchi', enable_gnocchi ),
+ ( 'haproxy', enable_haproxy ),
+ ( 'heat', enable_heat ),
+ ( 'keepalived', enable_haproxy ),
+ ( 'keystone', enable_keystone ),
+ ( 'magnum', enable_magnum ),
+ ( 'manila', enable_manila ),
+ ( 'mariadb', enable_mariadb ),
+ ( 'mistral', enable_mistral ),
+ ( 'murano', enable_murano ),
+ ( 'neutron', enable_neutron ),
+ ( 'nova', enable_nova ),
+ ( 'rabbitmq', enable_rabbitmq ),
+ ( 'senlin', enable_senlin ),
+ ( 'swift', enable_swift )
] %}
{
"command": "{{ cron_cmd }}",
@@ -31,13 +31,13 @@
"owner": "root",
"perm": "0644"
},
-{% for service in services %}
+{% for service, enabled in services if enabled | bool %}
{
"source": "{{ container_config_directory }}/logrotate/{{ service }}.conf",
"dest": "/etc/logrotate.d/{{ service }}.conf",
"owner": "root",
"perm": "0644"
- }{% if not loop.last %},{% endif %}
+ }{{ ',' if not loop.last else '' }}
{% endfor %}
]