|
| 1 | +{{ ansible_managed | comment }} |
| 2 | + |
| 3 | +{% if nginx_agent_server is defined and nginx_agent_server is mapping %} |
| 4 | +server: |
| 5 | +{% if nginx_agent_server['data_plane_key'] is defined %} |
| 6 | + token: {{ nginx_agent_server['data_plane_key'] }} |
| 7 | +{% endif %} |
| 8 | + host: {{ nginx_agent_server['host'] }} |
| 9 | + grpcPort: {{ nginx_agent_server['port'] }} |
| 10 | +{% endif %} |
| 11 | + |
| 12 | +{% if nginx_agent_tls is defined and nginx_agent_tls is mapping %} |
| 13 | +tls: |
| 14 | + enable: {{ nginx_agent_tls['enable'] | bool }} |
| 15 | + skip_verify: {{ nginx_agent_tls['skip_verify'] | bool }} |
| 16 | +{% if nginx_agent_tls['cert'] is defined %} |
| 17 | + cert: {{ nginx_agent_tls['cert'] }} |
| 18 | +{% endif %} |
| 19 | +{% if nginx_agent_tls['key'] is defined %} |
| 20 | + key: {{ nginx_agent_tls['key'] }} |
| 21 | +{% endif %} |
| 22 | +{% if nginx_agent_tls['ca'] is defined %} |
| 23 | + ca: {{ nginx_agent_tls['ca'] }} |
| 24 | +{% endif %} |
| 25 | +{% endif %} |
| 26 | + |
| 27 | +{% if nginx_agent_log is defined and nginx_agent_log is mapping %} |
| 28 | +log: |
| 29 | +{% if nginx_agent_log['level'] is defined %} |
| 30 | + level: {{ nginx_agent_log['level'] }} |
| 31 | +{% endif %} |
| 32 | +{% if nginx_agent_log['path'] is defined %} |
| 33 | + path: {{ nginx_agent_log['path'] }} |
| 34 | +{% endif %} |
| 35 | +{% endif %} |
| 36 | + |
| 37 | +{% if nginx_agent_nginx is defined and nginx_agent_nginx is mapping %} |
| 38 | +nginx: |
| 39 | +{% if nginx_agent_nginx['exclude_logs'] is defined %} |
| 40 | + exclude_logs: {{ nginx_agent_nginx['exclude_logs'] }} |
| 41 | +{% endif %} |
| 42 | +{% if nginx_agent_nginx['socket'] is defined %} |
| 43 | + socket: {{ nginx_agent_nginx['socket'] }} |
| 44 | +{% endif %} |
| 45 | +{% if nginx_agent_nginx['treat_warnings_as_errors'] is defined and nginx_agent_nginx['treat_warnings_as_errors'] is boolean %} |
| 46 | + treat_warnings_as_errors: {{ nginx_agent_nginx['treat_warnings_as_errors'] | ternary('true', 'false') }} |
| 47 | +{% endif %} |
| 48 | +{% endif %} |
| 49 | + |
| 50 | +{% if nginx_agent_dataplane_status is defined and nginx_agent_dataplane_status is mapping %} |
| 51 | +dataplane: |
| 52 | + status: |
| 53 | +{% if nginx_agent_dataplane_status['poll_interval'] is defined %} |
| 54 | + poll_interval: {{ nginx_agent_dataplane_status['poll_interval'] }} |
| 55 | +{% endif %} |
| 56 | +{% if nginx_agent_dataplane_status['report_interval'] is defined %} |
| 57 | + report_interval: {{ nginx_agent_dataplane_status['report_interval'] }} |
| 58 | +{% endif %} |
| 59 | +{% endif %} |
| 60 | + |
| 61 | +{% if nginx_agent_metrics is defined and nginx_agent_metrics is mapping %} |
| 62 | +metrics: |
| 63 | +{% if nginx_agent_metrics['bulk_size'] is defined and nginx_agent_metrics['bulk_size'] is number %} |
| 64 | + bulk_size: {{ nginx_agent_metrics['bulk_size'] }} |
| 65 | +{% endif %} |
| 66 | +{% if nginx_agent_metrics['report_interval'] is defined %} |
| 67 | + report_interval: {{ nginx_agent_metrics['report_interval'] }} |
| 68 | +{% endif %} |
| 69 | +{% if nginx_agent_metrics['collection_interval'] is defined %} |
| 70 | + collection_interval: {{ nginx_agent_metrics['collection_interval'] }} |
| 71 | +{% endif %} |
| 72 | +{% if nginx_agent_metrics['mode'] is defined %} |
| 73 | + mode: {{ nginx_agent_metrics['mode'] }} |
| 74 | +{% endif %} |
| 75 | +{% endif %} |
| 76 | + |
| 77 | +{% if nginx_agent_config_dirs is defined %} |
| 78 | +config_dirs: {{ nginx_agent_config_dirs }} |
| 79 | +{% endif %} |
| 80 | + |
| 81 | +{% if nginx_agent_queue_size is defined and nginx_agent_queue_size is number %} |
| 82 | +queue_size: {{ nginx_agent_queue_size }} |
| 83 | +{% endif %} |
| 84 | + |
| 85 | +{% if nginx_agent_features is defined and nginx_agent_features is not mapping and nginx_agent_features is not string and nginx_agent_features | length > 0 %} |
| 86 | +features: |
| 87 | +{% for feature in nginx_agent_features %} |
| 88 | + {{ "- " + feature }} |
| 89 | +{% endfor %} |
| 90 | +{% endif %} |
| 91 | + |
| 92 | +{% if nginx_agent_extensions is defined and nginx_agent_extensions is not mapping and nginx_agent_extensions is not string and nginx_agent_extensions | length > 0 %} |
| 93 | +extensions: |
| 94 | +{% for extension in nginx_agent_extensions %} |
| 95 | + {{ "- " + extension }} |
| 96 | +{% endfor %} |
| 97 | +{% endif %} |
| 98 | + |
| 99 | +{% if nginx_agent_app_protect is defined and nginx_agent_app_protect is mapping %} |
| 100 | +nginx_app_protect: |
| 101 | +{% if nginx_agent_app_protect['report_interval'] is defined %} |
| 102 | + report_interval: {{ nginx_agent_app_protect['report_interval'] }} |
| 103 | +{% endif %} |
| 104 | +{% if nginx_agent_app_protect['precompiled_publication'] is defined and nginx_agent_app_protect['precompiled_publication'] is boolean %} |
| 105 | + precompiled_publication: {{ nginx_agent_app_protect['precompiled_publication'] | ternary('true', 'false') }} |
| 106 | +{% endif %} |
| 107 | +{% endif %} |
| 108 | + |
| 109 | +{% if nginx_agent_api is defined and nginx_agent_api is mapping %} |
| 110 | +api: |
| 111 | +{% if nginx_agent_api['host'] is defined %} |
| 112 | + host: {{ nginx_agent_api['host'] }} |
| 113 | +{% endif %} |
| 114 | +{% if nginx_agent_api['port'] is defined %} |
| 115 | + port: {{ nginx_agent_api['port'] }} |
| 116 | +{% endif %} |
| 117 | +{% if nginx_agent_api['cert'] is defined %} |
| 118 | + cert: {{ nginx_agent_api['cert'] }} |
| 119 | +{% endif %} |
| 120 | +{% if nginx_agent_api['key'] is defined %} |
| 121 | + key: {{ nginx_agent_api['key'] }} |
| 122 | +{% endif %} |
| 123 | +{% endif %} |
0 commit comments