move the bulk to templates into the new roles

This change will help with organization throughout the stack.

Change-Id: I2ad865db534ae1d377bbdecd4b421ee0fc802536
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-08-11 23:53:24 -05:00
parent 8d08863b42
commit 45df59ed7e
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3
85 changed files with 98 additions and 65 deletions

View File

@ -64,8 +64,8 @@
- name: Drop apm-server conf file - name: Drop apm-server conf file
template: template:
src: templates/apm-server.yml.j2 src: "apm-server.yml.j2"
dest: /etc/apm-server/apm-server.yml dest: "/etc/apm-server/apm-server.yml"
notify: notify:
- Enable and restart apm server - Enable and restart apm server

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -0,0 +1 @@
../../../templates/_include_beat_logging.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_elasticsearch_output.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_kibana_setup.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_dashboards.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_template.yml.j2

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -0,0 +1 @@
../../../templates/_include_beat_logging.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_kibana_setup.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_log_stash_output.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_dashboards.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_template.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_xpack_elasticsearch_output.yml.j2

View File

@ -79,16 +79,14 @@
- "/var/log/curator" - "/var/log/curator"
- "/etc/curator" - "/etc/curator"
- name: Drop curator conf file - name: Drop curator conf file(s)
template: template:
src: templates/curator.yml.j2 src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- src: "curator.yml.j2"
dest: /var/lib/curator/curator.yml dest: /var/lib/curator/curator.yml
notify: - src: "curator-actions.yml.j2"
- Enable and restart curator.timer
- name: Drop curator action file
template:
src: templates/curator-actions.yml.j2
dest: /var/lib/curator/actions.yml dest: /var/lib/curator/actions.yml
notify: notify:
- Enable and restart curator.timer - Enable and restart curator.timer

View File

@ -52,6 +52,7 @@
- name: Set elastic heap defaults - name: Set elastic heap defaults
set_fact: set_fact:
elastic_heap_size_default: "{{ _elastic_heap_size_default }}" elastic_heap_size_default: "{{ _elastic_heap_size_default }}"
elastic_log_rotate_path: "/var/log/{{ service_name }}"
- name: Configure systcl vm.max_map_count=262144 on container hosts - name: Configure systcl vm.max_map_count=262144 on container hosts
sysctl: sysctl:
@ -165,5 +166,7 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
with_items: with_items:
- src: templates/jvm.options.j2 - src: "jvm.options.j2"
dest: /etc/{{ service_name }}/jvm.options dest: "/etc/{{ service_name }}/jvm.options"
- src: "templates/logrotate.j2"
dest: "/etc/logrotate.d/{{ service_name }}"

View File

@ -174,8 +174,8 @@
- name: Drop Filebeat conf file - name: Drop Filebeat conf file
template: template:
src: templates/filebeat.yml.j2 src: "filebeat.yml.j2"
dest: /etc/filebeat/filebeat.yml dest: "/etc/filebeat/filebeat.yml"
notify: notify:
- Enable and restart filebeat - Enable and restart filebeat

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -0,0 +1 @@
../../../templates/_include_beat_logging.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_kibana_setup.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_log_stash_output.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_dashboards.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_template.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_xpack_elasticsearch_output.yml.j2

View File

@ -70,8 +70,8 @@
when: when:
- ansible_service_mgr == 'systemd' - ansible_service_mgr == 'systemd'
with_items: with_items:
- src: templates/heartbeat.yml.j2 - src: "heartbeat.yml.j2"
dest: /etc/heartbeat/heartbeat.yml dest: "/etc/heartbeat/heartbeat.yml"
notify: notify:
- Enable and restart heartbeat - Enable and restart heartbeat

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -0,0 +1 @@
../../../templates/_include_beat_logging.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_kibana_setup.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_log_stash_output.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_dashboards.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_template.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_xpack_elasticsearch_output.yml.j2

View File

@ -112,8 +112,8 @@
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
mode: "0644" mode: "0644"
with_items: with_items:
- src: templates/journalbeat.yml.j2 - src: "journalbeat.yml.j2"
dest: /etc/journalbeat/journalbeat.yml dest: "/etc/journalbeat/journalbeat.yml"
notify: notify:
- Enable and restart journalbeat - Enable and restart journalbeat

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -0,0 +1 @@
../../../templates/_include_beat_logging.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_kibana_setup.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_log_stash_output.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_dashboards.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_template.yml.j2

View File

@ -51,8 +51,8 @@
- name: Drop Nginx default conf file - name: Drop Nginx default conf file
template: template:
src: templates/nginx_default.j2 src: "nginx_default.j2"
dest: /etc/nginx/sites-available/default dest: "/etc/nginx/sites-available/default"
notify: notify:
- Enable and restart services - Enable and restart services
@ -81,8 +81,8 @@
- name: Drop kibana conf file - name: Drop kibana conf file
template: template:
src: templates/kibana.yml.j2 src: "kibana.yml.j2"
dest: /etc/kibana/kibana.yml dest: "/etc/kibana/kibana.yml"
mode: "0666" mode: "0666"
notify: notify:
- Enable and restart services - Enable and restart services

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
temp_dir: /var/lib/logstash/tmp temp_dir: /var/lib/logstash/tmp
logstash_pipelines: "{{lookup('template', 'templates/logstash-pipelines.yml.j2') }}" logstash_pipelines: "{{lookup('template', 'logstash-pipelines.yml.j2') }}"
# Set processor cores fact # Set processor cores fact
q_storage: "{{ (ansible_processor_cores | int) * (ansible_processor_threads_per_core | int) * 2 }}" q_storage: "{{ (ansible_processor_cores | int) * (ansible_processor_threads_per_core | int) * 2 }}"

View File

@ -96,12 +96,10 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
with_items: with_items:
- src: templates/logstash.yml.j2 - src: "logstash.yml.j2"
dest: /etc/logstash/logstash.yml dest: "/etc/logstash/logstash.yml"
- src: templates/logstash-pipelines.yml.j2 - src: "logstash-pipelines.yml.j2"
dest: /etc/logstash/pipelines.yml dest: "/etc/logstash/pipelines.yml"
- src: "templates/logrotate.j2"
dest: "/etc/logrotate.d/logstash"
notify: notify:
- Enable and restart logstash - Enable and restart logstash
tags: tags:

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -0,0 +1 @@
../../../templates/logstash-pipelines.yml.j2

View File

@ -230,8 +230,8 @@
when: when:
- ansible_service_mgr == 'systemd' - ansible_service_mgr == 'systemd'
with_items: with_items:
- src: templates/metricbeat.yml.j2 - src: "metricbeat.yml.j2"
dest: /etc/metricbeat/metricbeat.yml dest: "/etc/metricbeat/metricbeat.yml"
notify: notify:
- Enable and restart metricbeat - Enable and restart metricbeat

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -0,0 +1 @@
../../../templates/_include_beat_logging.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_kibana_setup.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_log_stash_output.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_dashboards.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_template.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_xpack_elasticsearch_output.yml.j2

View File

@ -68,8 +68,8 @@
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
mode: "0644" mode: "0644"
with_items: with_items:
- src: templates/packetbeat.yml.j2 - src: "packetbeat.yml.j2"
dest: /etc/packetbeat/packetbeat.yml dest: "/etc/packetbeat/packetbeat.yml"
notify: notify:
- Enable and restart packetbeat - Enable and restart packetbeat

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -0,0 +1 @@
../../../templates/_include_beat_logging.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_kibana_setup.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_log_stash_output.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_dashboards.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_setup_template.yml.j2

View File

@ -0,0 +1 @@
../../../templates/_include_xpack_elasticsearch_output.yml.j2

View File

@ -73,12 +73,10 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
with_items: with_items:
- src: templates/elasticsearch.yml.j2 - src: "elasticsearch.yml.j2"
dest: /etc/elasticsearch/elasticsearch.yml dest: "/etc/elasticsearch/elasticsearch.yml"
- src: templates/jvm.options.j2 - src: "es-log4j2.properties.j2"
dest: /etc/elasticsearch/jvm.options dest: "/etc/elasticsearch/log4j2.properties"
- src: templates/es-log4j2.properties.j2
dest: /etc/elasticsearch/log4j2.properties
notify: notify:
- Enable and restart elastic - Enable and restart elastic
tags: tags:
@ -105,11 +103,6 @@
group: "elasticsearch" group: "elasticsearch"
mode: "0750" mode: "0750"
- name: Create logrotate config
template:
src: "templates/logrotate.j2"
dest: "/etc/logrotate.d/elasticsearch"
- include_tasks: "elasticsearch_nfs_setup.yml" - include_tasks: "elasticsearch_nfs_setup.yml"
when: when:
- elastic_shared_fs_repos is defined - elastic_shared_fs_repos is defined

View File

@ -0,0 +1,6 @@
{% include 'templates/systemd.general-overrides.conf.j2' %}
# This first line clears the source ExecStart
ExecStart=
# This runs our ExecStart as an override.
ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid

View File

@ -0,0 +1 @@
../../../templates/systemd.general-overrides.conf.j2

View File

@ -1,18 +0,0 @@
[Service]
# This first line clears the source ExecStart
ExecStart=
# This runs our ExecStart as an override.
ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid
# This creates a specific slice to operate from. The accounting options give us
# the ability to see resource usage through the `systemd-cgtop` command and
# further isolate this service from the host machine.
Slice=elastic.slice
CPUAccounting=true
BlockIOAccounting=true
MemoryAccounting=true
TasksAccounting=true
# Sandbox setup
PrivateTmp=true
PrivateDevices={{ ((ansible_os_family | lower) != "redhat") | lower }}

View File

@ -111,7 +111,8 @@
args: args:
chdir: "src/{{ current_test_repo }}/elk_metrics_6x/tests" chdir: "src/{{ current_test_repo }}/elk_metrics_6x/tests"
when: when:
- ansible_service_mgr != 'systemd' - ansible_service_mgr != 'systemd' or
not (contianer_inventory | bool)
- name: Run environment setup - name: Run environment setup
become: yes become: yes
@ -125,6 +126,7 @@
chdir: "src/{{ current_test_repo }}/elk_metrics_6x/tests" chdir: "src/{{ current_test_repo }}/elk_metrics_6x/tests"
when: when:
- ansible_service_mgr == 'systemd' - ansible_service_mgr == 'systemd'
- contianer_inventory | bool
- name: Wait 15 seconds - name: Wait 15 seconds
command: "sleep 15" command: "sleep 15"