Skip to content

Commit 063c877

Browse files
committed
Merge branch 'docker_log_options' of 'https://github.com/zhquan/bap-deployment-toolkit'
Merges #110 Closes #110
2 parents bfd4b0c + 3b67fad commit 063c877

File tree

17 files changed

+50
-0
lines changed

17 files changed

+50
-0
lines changed

ansible/roles/mariadb/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ mariadb_backup_script: /usr/local/bin/mariadb_backup.sh
4848
mariadb_innodb_buffer_pool_size: 6871947673
4949

5050
docker_network_name: bap_network
51+
docker_log_max_size: 500m

ansible/roles/mariadb/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
volumes:
5151
- mariadb_data:/var/lib/mysql
5252
- "{{ mariadb_logs_dir }}:/var/log/mysql/"
53+
log_driver: json-file
54+
log_options:
55+
max-size: "{{ docker_log_max_size }}"
5356
register: result
5457
retries: 2
5558
delay: 5

ansible/roles/mordred/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ mariadb_hosts: "{{ groups['all_in_one'][0] | default(groups['mariadb'][0]) }}"
3838
opensearch_host: "{{ groups['all_in_one'][0] | default(groups['opensearch'][0]) }}"
3939

4040
docker_network_name: bap_network
41+
docker_log_max_size: 500m

ansible/roles/mordred/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
- "{{ mordred_instances_dir }}/{{ item.project }}/sources/:/home/grimoire/data-sources/"
4545
- "{{ mordred_instances_dir }}/{{ item.project }}/logs/:/home/grimoire/logs/"
4646
- "{{ mordred_instances_dir }}/{{ item.project }}/perceval-cache/:/home/grimoire/.perceval/"
47+
log_driver: json-file
48+
log_options:
49+
max-size: "{{ docker_log_max_size }}"
4750
with_items:
4851
- "{{ instances }}"
4952
delegate_to: "{{ groups['all_in_one'][0] | default(groups['mordred'][item.mordred.host]) }}"

ansible/roles/nginx/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ gcloud_apt_deb_ubuntu_repository: >-
7272
https://packages.cloud.google.com/apt cloud-sdk main
7373
7474
docker_network_name: bap_network
75+
docker_log_max_size: 500m

ansible/roles/nginx/tasks/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
exposed_ports:
8282
- "80"
8383
- "443"
84+
log_driver: json-file
85+
log_options:
86+
max-size: "{{ docker_log_max_size }}"
8487
when: custom_cert is undefined
8588

8689
- name: Configure virtualhost(s) for all instances
@@ -105,6 +108,9 @@
105108
exposed_ports:
106109
- "80"
107110
- "443"
111+
log_driver: json-file
112+
log_options:
113+
max-size: "{{ docker_log_max_size }}"
108114

109115
- name: Launch first rsync
110116
shell: gsutil -m rsync -d -r "gs://{{ sortinghat_assets_bucket }}/" "{{ nginx_gcs_workdir }}"

ansible/roles/opensearch/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,4 @@ gcp_service_account_file: "{{ opensearch_keys_dir }}/gcs_credentials.json"
118118
gcs_cred_file_container: "/usr/share/opensearch/config/gcs_credentials.json"
119119

120120
docker_network_name: bap_network
121+
docker_log_max_size: 500m

ansible/roles/opensearch/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@
117117
- "9200"
118118
- "9300"
119119
- "9600"
120+
log_driver: json-file
121+
log_options:
122+
max-size: "{{ docker_log_max_size }}"
120123

121124
- name: Init OpenSearch security plugin
122125
import_tasks: security_admin.yml

ansible/roles/opensearch_dashboards/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,4 @@ opensearch_dashboards_cert_fqdn: opensearch.example.org
6767
# opensearch_dashboards_multiple_auth: true
6868

6969
docker_network_name: bap_network
70+
docker_log_max_size: 500m

ansible/roles/opensearch_dashboards/tasks/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
- "{{ opensearch_dashboards_workdir }}/opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml"
5454
ports:
5555
- "{{ network.bind_host }}:5601:5601"
56+
log_driver: json-file
57+
log_options:
58+
max-size: "{{ docker_log_max_size }}"
5659
delegate_to: "{{ groups['opensearch_dashboards'][0] }}"
5760
when: "'opensearch_dashboards' in groups and inventory_hostname in groups['opensearch_dashboards']"
5861

@@ -70,6 +73,9 @@
7073
- "{{ opensearch_dashboards_workdir }}/opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml"
7174
ports:
7275
- "{{ network.bind_host }}:5601:5601"
76+
log_driver: json-file
77+
log_options:
78+
max-size: "{{ docker_log_max_size }}"
7379
delegate_to: "{{ groups['opensearch_dashboards_anonymous'][0] }}"
7480
when: "'opensearch_dashboards_anonymous' in groups and inventory_hostname in groups['opensearch_dashboards_anonymous']"
7581

@@ -87,4 +93,7 @@
8793
- "{{ opensearch_dashboards_workdir }}/opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml"
8894
ports:
8995
- "{{ network.bind_host }}:5601:5601"
96+
log_driver: json-file
97+
log_options:
98+
max-size: "{{ docker_log_max_size }}"
9099
when: "'all_in_one' in groups and inventory_hostname in groups['all_in_one']"

0 commit comments

Comments
 (0)