Add trusty support to the project
This change adds Ubuntu 14.04 support to the project. Change-Id: I20695e19409b63c6e1def4ccf8929c6d52be647e Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
4474a40989
commit
79c3a3cf93
|
@ -17,8 +17,9 @@ export OPTS=()
|
||||||
export ANSIBLE_EMBED_HOME="${HOME}/ansible25"
|
export ANSIBLE_EMBED_HOME="${HOME}/ansible25"
|
||||||
OPTS+=('ANSIBLE_EMBED_HOME')
|
OPTS+=('ANSIBLE_EMBED_HOME')
|
||||||
|
|
||||||
|
source /etc/os-release
|
||||||
if [[ ! -e "${ANSIBLE_EMBED_HOME}/bin/ansible" ]]; then
|
if [[ ! -e "${ANSIBLE_EMBED_HOME}/bin/ansible" ]]; then
|
||||||
if [ ${DISTRIB_RELEASE} = "14.04" ]; then
|
if [ ${VERSION_ID} = "14.04" ]; then
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get -y install python-virtualenv
|
apt-get -y install python-virtualenv
|
||||||
echo "done installing python-virtualenv"
|
echo "done installing python-virtualenv"
|
||||||
|
|
|
@ -22,5 +22,53 @@
|
||||||
roles:
|
roles:
|
||||||
- role: elastic_kibana
|
- role: elastic_kibana
|
||||||
|
|
||||||
|
post_tasks:
|
||||||
|
- name: Create basic indexes
|
||||||
|
uri:
|
||||||
|
url: "http://127.0.0.1:5601/api/saved_objects/index-pattern/{{ item.name }}"
|
||||||
|
method: POST
|
||||||
|
body: "{{ item.index_options | to_json }}"
|
||||||
|
status_code: 200,409
|
||||||
|
body_format: json
|
||||||
|
headers:
|
||||||
|
Content-Type: "application/json"
|
||||||
|
kbn-xsrf: "{{ inventory_hostname | to_uuid }}"
|
||||||
|
with_items:
|
||||||
|
- name: "*"
|
||||||
|
index_options:
|
||||||
|
attributes:
|
||||||
|
title: "*"
|
||||||
|
timeFieldName: "@timestamp"
|
||||||
|
- name: "journalbeat-*"
|
||||||
|
index_options:
|
||||||
|
attributes:
|
||||||
|
title: "journalbeat-*"
|
||||||
|
timeFieldName: "@timestamp"
|
||||||
|
register: kibana_indexes
|
||||||
|
until: kibana_indexes is success
|
||||||
|
retries: 6
|
||||||
|
delay: 10
|
||||||
|
run_once: true
|
||||||
|
|
||||||
|
- name: Create basic indexes
|
||||||
|
uri:
|
||||||
|
url: "http://127.0.0.1:5601/api/kibana/settings/defaultIndex"
|
||||||
|
method: POST
|
||||||
|
body: "{{ item.index_options | to_json }}"
|
||||||
|
status_code: 200
|
||||||
|
body_format: json
|
||||||
|
headers:
|
||||||
|
Content-Type: "application/json"
|
||||||
|
kbn-xsrf: "{{ inventory_hostname | to_uuid }}"
|
||||||
|
with_items:
|
||||||
|
- name: "*"
|
||||||
|
index_options:
|
||||||
|
value: "*"
|
||||||
|
register: kibana_indexes
|
||||||
|
until: kibana_indexes is success
|
||||||
|
retries: 6
|
||||||
|
delay: 10
|
||||||
|
run_once: true
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- server-install
|
- server-install
|
||||||
|
|
|
@ -13,13 +13,21 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable and restart apm server
|
- name: Enable and restart apm-server (systemd)
|
||||||
systemd:
|
systemd:
|
||||||
name: "apm-server"
|
name: "apm-server"
|
||||||
enabled: true
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
- ansible_service_mgr == 'systemd'
|
||||||
tags:
|
listen: Enable and restart apm server
|
||||||
- config
|
|
||||||
|
- name: Enable and restart apm-server (upstart)
|
||||||
|
service:
|
||||||
|
name: "apm-server"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
listen: Enable and restart apm server
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -46,12 +46,16 @@
|
||||||
group: "root"
|
group: "root"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
- name: Apply systemd options
|
- name: Apply systemd options
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "/etc/systemd/system/apm-server.service.d/{{ item.dest }}"
|
dest: "/etc/systemd/system/apm-server.service.d/{{ item.dest }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
with_items:
|
with_items:
|
||||||
- src: "systemd.general-overrides.conf.j2"
|
- src: "systemd.general-overrides.conf.j2"
|
||||||
dest: "apm-server-overrides.conf"
|
dest: "apm-server-overrides.conf"
|
||||||
|
@ -66,5 +70,6 @@
|
||||||
- Enable and restart apm server
|
- Enable and restart apm server
|
||||||
|
|
||||||
- include_tasks: apm_setup.yml
|
- include_tasks: apm_setup.yml
|
||||||
tags:
|
|
||||||
- setup
|
- name: Force beat handlers
|
||||||
|
meta: flush_handlers
|
||||||
|
|
|
@ -13,13 +13,21 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable and restart auditbeat
|
- name: Enable and restart auditbeat (systemd)
|
||||||
systemd:
|
systemd:
|
||||||
name: "auditbeat"
|
name: "auditbeat"
|
||||||
enabled: "true"
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
- ansible_service_mgr == 'systemd'
|
||||||
tags:
|
listen: Enable and restart auditbeat
|
||||||
- config
|
|
||||||
|
- name: Enable and restart auditbeat (upstart)
|
||||||
|
service:
|
||||||
|
name: "auditbeat"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
listen: Enable and restart auditbeat
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -46,12 +46,16 @@
|
||||||
group: "root"
|
group: "root"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
- name: Apply systemd options
|
- name: Apply systemd options
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "/etc/systemd/system/auditbeat.service.d/{{ item.dest }}"
|
dest: "/etc/systemd/system/auditbeat.service.d/{{ item.dest }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
with_items:
|
with_items:
|
||||||
- src: "systemd.general-overrides.conf.j2"
|
- src: "systemd.general-overrides.conf.j2"
|
||||||
dest: "auditbeat-overrides.conf"
|
dest: "auditbeat-overrides.conf"
|
||||||
|
@ -66,3 +70,6 @@
|
||||||
- Enable and restart auditbeat
|
- Enable and restart auditbeat
|
||||||
|
|
||||||
- include_tasks: auditbeat_setup.yml
|
- include_tasks: auditbeat_setup.yml
|
||||||
|
|
||||||
|
- name: Force beat handlers
|
||||||
|
meta: flush_handlers
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
---
|
||||||
|
# Copyright 2018, Rackspace US, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
- name: Run the systemd service role
|
||||||
|
include_role:
|
||||||
|
name: systemd_service
|
||||||
|
private: true
|
||||||
|
vars:
|
||||||
|
systemd_service_enabled: "{{ ((elk_package_state | default('present')) != 'absent') | ternary(true, false) }}"
|
||||||
|
systemd_service_restart_changed: false
|
||||||
|
systemd_user_name: curator
|
||||||
|
systemd_group_name: curator
|
||||||
|
systemd_services:
|
||||||
|
- service_name: "curator"
|
||||||
|
execstarts:
|
||||||
|
- /opt/elasticsearch-curator/bin/curator
|
||||||
|
--config /var/lib/curator/curator.yml
|
||||||
|
/var/lib/curator/actions.yml
|
||||||
|
timer:
|
||||||
|
state: "started"
|
||||||
|
options:
|
||||||
|
OnBootSec: 30min
|
||||||
|
OnUnitActiveSec: 24h
|
||||||
|
Persistent: true
|
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
# Copyright 2018, Rackspace US, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
- name: Create cron job for curator
|
||||||
|
cron:
|
||||||
|
name: "Run curator"
|
||||||
|
minute: 0
|
||||||
|
hour: 2
|
||||||
|
user: "curator"
|
||||||
|
job: "/opt/elasticsearch-curator/bin/curator --config /var/lib/curator/curator.yml /var/lib/curator/actions.yml"
|
||||||
|
cron_file: "elasticsearch-curator"
|
|
@ -25,6 +25,11 @@
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
|
- name: exit playbook after uninstall
|
||||||
|
meta: end_play
|
||||||
|
when:
|
||||||
|
ansible_service_mgr != 'systemd'
|
||||||
|
|
||||||
- name: Ensure virtualenv is installed
|
- name: Ensure virtualenv is installed
|
||||||
package:
|
package:
|
||||||
name: "{{ curator_distro_packages }}"
|
name: "{{ curator_distro_packages }}"
|
||||||
|
@ -88,24 +93,4 @@
|
||||||
notify:
|
notify:
|
||||||
- Enable and restart curator.timer
|
- Enable and restart curator.timer
|
||||||
|
|
||||||
- name: Run the systemd service role
|
- include_tasks: "curator_{{ ansible_service_mgr }}.yml"
|
||||||
include_role:
|
|
||||||
name: systemd_service
|
|
||||||
private: true
|
|
||||||
vars:
|
|
||||||
systemd_service_enabled: "{{ ((elk_package_state | default('present')) != 'absent') | ternary(true, false) }}"
|
|
||||||
systemd_service_restart_changed: false
|
|
||||||
systemd_user_name: curator
|
|
||||||
systemd_group_name: curator
|
|
||||||
systemd_services:
|
|
||||||
- service_name: "curator"
|
|
||||||
execstarts:
|
|
||||||
- /opt/elasticsearch-curator/bin/curator
|
|
||||||
--config /var/lib/curator/curator.yml
|
|
||||||
/var/lib/curator/actions.yml
|
|
||||||
timer:
|
|
||||||
state: "started"
|
|
||||||
options:
|
|
||||||
OnBootSec: 30min
|
|
||||||
OnUnitActiveSec: 24h
|
|
||||||
Persistent: true
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -23,6 +23,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
path: "/var/lib/{{ service_name }}"
|
path: "/var/lib/{{ service_name }}"
|
||||||
register: service_dir
|
register: service_dir
|
||||||
|
|
||||||
- name: Check for existing rollup job
|
- name: Check for data directory
|
||||||
debug:
|
debug:
|
||||||
msg: >-
|
msg: >-
|
||||||
The service data directory [ /var/lib/{{ service_name }} ] already
|
The service data directory [ /var/lib/{{ service_name }} ] already
|
||||||
|
|
|
@ -13,13 +13,21 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable and restart filebeat
|
- name: Enable and restart filebeat (systemd)
|
||||||
systemd:
|
systemd:
|
||||||
name: "filebeat"
|
name: "filebeat"
|
||||||
enabled: true
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
- ansible_service_mgr == 'systemd'
|
||||||
tags:
|
listen: Enable and restart filebeat
|
||||||
- config
|
|
||||||
|
- name: Enable and restart filebeat (upstart)
|
||||||
|
service:
|
||||||
|
name: "filebeat"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
listen: Enable and restart filebeat
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -46,14 +46,19 @@
|
||||||
group: "root"
|
group: "root"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
- name: Apply systemd options
|
- name: Apply systemd options
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "/etc/systemd/system/filebeat.service.d/{{ item.dest }}"
|
dest: "/etc/systemd/system/filebeat.service.d/{{ item.dest }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
with_items:
|
with_items:
|
||||||
- { src: "systemd.general-overrides.conf.j2", dest: "filebeat-overrides.conf" }
|
- src: "systemd.general-overrides.conf.j2"
|
||||||
|
dest: "filebeat-overrides.conf"
|
||||||
notify:
|
notify:
|
||||||
- Enable and restart filebeat
|
- Enable and restart filebeat
|
||||||
|
|
||||||
|
@ -175,3 +180,6 @@
|
||||||
- Enable and restart filebeat
|
- Enable and restart filebeat
|
||||||
|
|
||||||
- include_tasks: filebeat_setup.yml
|
- include_tasks: filebeat_setup.yml
|
||||||
|
|
||||||
|
- name: Force beat handlers
|
||||||
|
meta: flush_handlers
|
||||||
|
|
|
@ -13,13 +13,21 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable and restart heartbeat
|
- name: Enable and restart heartbeat (systemd)
|
||||||
systemd:
|
systemd:
|
||||||
name: "heartbeat-elastic"
|
name: "heartbeat-elastic"
|
||||||
enabled: true
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
- ansible_service_mgr == 'systemd'
|
||||||
tags:
|
listen: Enable and restart heartbeat
|
||||||
- config
|
|
||||||
|
- name: Enable and restart heartbeat (upstart)
|
||||||
|
service:
|
||||||
|
name: "heartbeat-elastic"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
listen: Enable and restart heartbeat
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -46,18 +46,36 @@
|
||||||
group: "root"
|
group: "root"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
|
- name: Apply systemd options
|
||||||
|
template:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
with_items:
|
||||||
|
- src: "systemd.general-overrides.conf.j2"
|
||||||
|
dest: "/etc/systemd/system/heartbeat.service.d/heartbeat-overrides.conf"
|
||||||
|
notify:
|
||||||
|
- Enable and restart heartbeat
|
||||||
|
|
||||||
- name: Create heartbeat configs
|
- name: Create heartbeat configs
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
with_items:
|
with_items:
|
||||||
- src: "systemd.general-overrides.conf.j2"
|
|
||||||
dest: "/etc/systemd/system/heartbeat.service.d/heartbeat-overrides.conf"
|
|
||||||
- src: templates/heartbeat.yml.j2
|
- src: templates/heartbeat.yml.j2
|
||||||
dest: /etc/heartbeat/heartbeat.yml
|
dest: /etc/heartbeat/heartbeat.yml
|
||||||
notify:
|
notify:
|
||||||
- Enable and restart heartbeat
|
- Enable and restart heartbeat
|
||||||
|
|
||||||
- include_tasks: heartbeat_setup.yml
|
- include_tasks: heartbeat_setup.yml
|
||||||
|
|
||||||
|
- name: Force beat handlers
|
||||||
|
meta: flush_handlers
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
- name: exit playbook after uninstall
|
- name: exit playbook after uninstall
|
||||||
meta: end_play
|
meta: end_play
|
||||||
when:
|
when:
|
||||||
- not journal_dir.stat.exists | bool
|
- not (journal_dir.stat.exists | bool) or
|
||||||
|
ansible_service_mgr != 'systemd'
|
||||||
|
|
||||||
- name: Ensure beat is installed
|
- name: Ensure beat is installed
|
||||||
package:
|
package:
|
||||||
|
@ -94,7 +95,7 @@
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Drop journalbeat conf files
|
- name: Apply systemd options
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
@ -102,6 +103,15 @@
|
||||||
with_items:
|
with_items:
|
||||||
- src: "systemd.general-overrides.conf.j2"
|
- src: "systemd.general-overrides.conf.j2"
|
||||||
dest: "/etc/systemd/system/journalbeat.service.d/journalbeat-overrides.conf"
|
dest: "/etc/systemd/system/journalbeat.service.d/journalbeat-overrides.conf"
|
||||||
|
notify:
|
||||||
|
- Enable and restart journalbeat
|
||||||
|
|
||||||
|
- name: Drop journalbeat conf files
|
||||||
|
template:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: "0644"
|
||||||
|
with_items:
|
||||||
- src: templates/journalbeat.yml.j2
|
- src: templates/journalbeat.yml.j2
|
||||||
dest: /etc/journalbeat/journalbeat.yml
|
dest: /etc/journalbeat/journalbeat.yml
|
||||||
notify:
|
notify:
|
||||||
|
@ -132,3 +142,6 @@
|
||||||
After: network-online.target
|
After: network-online.target
|
||||||
|
|
||||||
- include_tasks: journalbeat_setup.yml
|
- include_tasks: journalbeat_setup.yml
|
||||||
|
|
||||||
|
- name: Force beat handlers
|
||||||
|
meta: flush_handlers
|
||||||
|
|
|
@ -13,25 +13,27 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable and restart nginx
|
- name: Enable and restart services (systemd)
|
||||||
systemd:
|
systemd:
|
||||||
name: "nginx"
|
name: "{{ item }}"
|
||||||
enabled: true
|
|
||||||
state: restarted
|
|
||||||
when:
|
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
|
||||||
listen: Enable and restart services
|
|
||||||
tags:
|
|
||||||
- config
|
|
||||||
|
|
||||||
- name: Enable and restart kibana
|
|
||||||
systemd:
|
|
||||||
name: "kibana"
|
|
||||||
enabled: true
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
- ansible_service_mgr == 'systemd'
|
||||||
|
with_items:
|
||||||
|
- nginx
|
||||||
|
- kibana
|
||||||
|
listen: Enable and restart services
|
||||||
|
|
||||||
|
- name: Enable and restart services (upstart)
|
||||||
|
service:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
with_items:
|
||||||
|
- nginx
|
||||||
|
- kibana
|
||||||
listen: Enable and restart services
|
listen: Enable and restart services
|
||||||
tags:
|
|
||||||
- config
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -63,15 +63,19 @@
|
||||||
group: "root"
|
group: "root"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
- name: Apply systemd options
|
- name: Apply systemd options
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "/etc/systemd/system/kibana.service.d/{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
with_items:
|
with_items:
|
||||||
- src: "systemd.general-overrides.conf.j2"
|
- src: "systemd.general-overrides.conf.j2"
|
||||||
dest: "kibana-overrides.conf"
|
dest: "/etc/systemd/system/kibana.service.d/kibana-overrides.conf"
|
||||||
notify:
|
notify:
|
||||||
- Enable and restart services
|
- Enable and restart services
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,21 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable and restart logstash
|
- name: Enable and restart logstash (systemd)
|
||||||
systemd:
|
systemd:
|
||||||
name: "logstash"
|
name: "logstash"
|
||||||
enabled: true
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
- ansible_service_mgr == 'systemd'
|
||||||
tags:
|
listen: Enable and restart logstash
|
||||||
- config
|
|
||||||
|
- name: Enable and restart logstash (upstart)
|
||||||
|
service:
|
||||||
|
name: "logstash"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
listen: Enable and restart logstash
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -46,15 +46,19 @@
|
||||||
group: "root"
|
group: "root"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
- name: Apply systemd options
|
- name: Apply systemd options
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "/etc/systemd/system/logstash.service.d/{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
with_items:
|
with_items:
|
||||||
- src: "systemd.general-overrides.conf.j2"
|
- src: "systemd.general-overrides.conf.j2"
|
||||||
dest: "logstash-overrides.conf"
|
dest: "/etc/systemd/system/logstash.service.d/logstash-overrides.conf"
|
||||||
notify:
|
notify:
|
||||||
- Enable and restart logstash
|
- Enable and restart logstash
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,21 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable and restart metricbeat
|
- name: Enable and restart metricbeat (systemd)
|
||||||
systemd:
|
systemd:
|
||||||
name: "metricbeat"
|
name: "metricbeat"
|
||||||
enabled: true
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
- ansible_service_mgr == 'systemd'
|
||||||
tags:
|
listen: Enable and restart metricbeat
|
||||||
- config
|
|
||||||
|
- name: Enable and restart metricbeat (upstart)
|
||||||
|
service:
|
||||||
|
name: "elasticsearch"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
listen: Enable and restart metricbeat
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -222,11 +222,13 @@
|
||||||
notify:
|
notify:
|
||||||
- Enable and restart metricbeat
|
- Enable and restart metricbeat
|
||||||
|
|
||||||
- name: Drop metricbeat conf file
|
- name: Drop metricbeat conf files
|
||||||
template:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
with_items:
|
with_items:
|
||||||
- src: templates/metricbeat.yml.j2
|
- src: templates/metricbeat.yml.j2
|
||||||
dest: /etc/metricbeat/metricbeat.yml
|
dest: /etc/metricbeat/metricbeat.yml
|
||||||
|
@ -234,3 +236,6 @@
|
||||||
- Enable and restart metricbeat
|
- Enable and restart metricbeat
|
||||||
|
|
||||||
- include_tasks: metricbeat_setup.yml
|
- include_tasks: metricbeat_setup.yml
|
||||||
|
|
||||||
|
- name: Force beat handlers
|
||||||
|
meta: flush_handlers
|
||||||
|
|
|
@ -13,13 +13,21 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable and restart packetbeat
|
- name: Enable and restart packetbeat (systemd)
|
||||||
systemd:
|
systemd:
|
||||||
name: "packetbeat"
|
name: "packetbeat"
|
||||||
enabled: true
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
- ansible_service_mgr == 'systemd'
|
||||||
tags:
|
listen: Enable and restart packetbeat
|
||||||
- config
|
|
||||||
|
- name: Enable and restart packetbeat (upstart)
|
||||||
|
service:
|
||||||
|
name: "elasticsearch"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
listen: Enable and restart packetbeat
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -46,6 +46,21 @@
|
||||||
group: "root"
|
group: "root"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
|
- name: Apply systemd options
|
||||||
|
template:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
with_items:
|
||||||
|
- src: "systemd.general-overrides.conf.j2"
|
||||||
|
dest: "/etc/systemd/system/packetbeat.service.d/packetbeat-overrides.conf"
|
||||||
|
notify:
|
||||||
|
- Enable and restart packetbeat
|
||||||
|
|
||||||
- name: Drop packetbeat conf files
|
- name: Drop packetbeat conf files
|
||||||
template:
|
template:
|
||||||
|
@ -53,11 +68,12 @@
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
with_items:
|
with_items:
|
||||||
- src: "systemd.general-overrides.conf.j2"
|
|
||||||
dest: "/etc/systemd/system/packetbeat.service.d/packetbeat-overrides.conf"
|
|
||||||
- src: templates/packetbeat.yml.j2
|
- src: templates/packetbeat.yml.j2
|
||||||
dest: /etc/packetbeat/packetbeat.yml
|
dest: /etc/packetbeat/packetbeat.yml
|
||||||
notify:
|
notify:
|
||||||
- Enable and restart packetbeat
|
- Enable and restart packetbeat
|
||||||
|
|
||||||
- include_tasks: packetbeat_setup.yml
|
- include_tasks: packetbeat_setup.yml
|
||||||
|
|
||||||
|
- name: Force beat handlers
|
||||||
|
meta: flush_handlers
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
# Copyright 2018, Rackspace US, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
# List of PPA repositories used on ubuntu based systems
|
||||||
|
elastic_repo_ppas: []
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -35,3 +35,8 @@
|
||||||
delay: 2
|
delay: 2
|
||||||
tags:
|
tags:
|
||||||
- package_install
|
- package_install
|
||||||
|
|
||||||
|
- name: Add PPA (legacy)
|
||||||
|
apt_repository:
|
||||||
|
repo: "{{ item }}"
|
||||||
|
with_items: "{{ elastic_repo_ppas }}"
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
# Copyright 2018, Rackspace US, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
elastic_repo_distro_packages:
|
||||||
|
- apt-transport-https
|
||||||
|
|
||||||
|
elastic_repo_ppas:
|
||||||
|
- "ppa:openjdk-r/ppa"
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
body_format: json
|
body_format: json
|
||||||
register: elk_indexes
|
register: elk_indexes
|
||||||
until: elk_indexes is success
|
until: elk_indexes is success
|
||||||
retries: 3
|
retries: 5
|
||||||
delay: 5
|
delay: 5
|
||||||
when:
|
when:
|
||||||
- hostvars[inventory_hostname]['elastic_' + index_name + '_retention'] > days_until_rollup
|
- hostvars[inventory_hostname]['elastic_' + index_name + '_retention'] > days_until_rollup
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
index_options: {}
|
index_options: {}
|
||||||
- url: "http://{{ coordination_nodes[0] }}/_xpack/rollup/job/rollup_{{ index_name }}"
|
- url: "http://{{ coordination_nodes[0] }}/_xpack/rollup/job/rollup_{{ index_name }}"
|
||||||
method: PUT
|
method: PUT
|
||||||
status_code: 200
|
status_code: 200,400
|
||||||
index_options:
|
index_options:
|
||||||
index_pattern: "{{ index_name }}-*"
|
index_pattern: "{{ index_name }}-*"
|
||||||
rollup_index: "rollup_{{ index_name }}"
|
rollup_index: "rollup_{{ index_name }}"
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
delay: "{{ days_until_rollup }}d"
|
delay: "{{ days_until_rollup }}d"
|
||||||
- url: "http://{{ coordination_nodes[0] }}/_xpack/rollup/job/rollup_{{ index_name }}/_start"
|
- url: "http://{{ coordination_nodes[0] }}/_xpack/rollup/job/rollup_{{ index_name }}/_start"
|
||||||
method: POST
|
method: POST
|
||||||
status_code: 200
|
status_code: 200,404
|
||||||
index_options: {}
|
index_options: {}
|
||||||
run_once: true
|
run_once: true
|
||||||
when:
|
when:
|
||||||
|
|
|
@ -13,13 +13,21 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Enable and restart elastic
|
- name: Enable and restart elasticsearch (systemd)
|
||||||
systemd:
|
systemd:
|
||||||
name: "elasticsearch"
|
name: "elasticsearch"
|
||||||
enabled: true
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (elk_package_state | default('present')) != 'absent'
|
- ansible_service_mgr == 'systemd'
|
||||||
tags:
|
listen: Enable and restart elastic
|
||||||
- config
|
|
||||||
|
- name: Enable and restart elasticsearch (upstart)
|
||||||
|
service:
|
||||||
|
name: "elasticsearch"
|
||||||
|
state: restarted
|
||||||
|
enabled: yes
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
listen: Enable and restart elastic
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -51,6 +51,22 @@
|
||||||
group: "root"
|
group: "root"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
|
- name: Apply systemd options
|
||||||
|
template:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
with_items:
|
||||||
|
- src: "systemd.elasticsearch-overrides.conf.j2"
|
||||||
|
dest: "/etc/systemd/system/elasticsearch.service.d/elasticsearch-overrides.conf"
|
||||||
|
notify:
|
||||||
|
- Enable and restart elastic
|
||||||
|
tags:
|
||||||
|
- config
|
||||||
|
|
||||||
- name: Drop elasticsearch conf file
|
- name: Drop elasticsearch conf file
|
||||||
template:
|
template:
|
||||||
|
@ -63,8 +79,6 @@
|
||||||
dest: /etc/elasticsearch/jvm.options
|
dest: /etc/elasticsearch/jvm.options
|
||||||
- src: templates/es-log4j2.properties.j2
|
- src: templates/es-log4j2.properties.j2
|
||||||
dest: /etc/elasticsearch/log4j2.properties
|
dest: /etc/elasticsearch/log4j2.properties
|
||||||
- src: "systemd.elasticsearch-overrides.conf.j2"
|
|
||||||
dest: "/etc/systemd/system/elasticsearch.service.d/elasticsearch-overrides.conf"
|
|
||||||
notify:
|
notify:
|
||||||
- Enable and restart elastic
|
- Enable and restart elastic
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -22,6 +22,7 @@ galaxy_info:
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- bionic
|
- bionic
|
||||||
categories:
|
categories:
|
||||||
|
|
|
@ -32,7 +32,9 @@ auditbeat.modules:
|
||||||
# The auditd module collects events from the audit framework in the Linux
|
# The auditd module collects events from the audit framework in the Linux
|
||||||
# kernel. You need to specify audit rules for the events that you want to audit.
|
# kernel. You need to specify audit rules for the events that you want to audit.
|
||||||
- module: auditd
|
- module: auditd
|
||||||
|
{% if ansible_kernel is version_compare('4.4', '>=') %}
|
||||||
socket_type: {{ (apply_security_hardening | default(true) | bool) | ternary('multicast', 'unicast') }}
|
socket_type: {{ (apply_security_hardening | default(true) | bool) | ternary('multicast', 'unicast') }}
|
||||||
|
{% endif %}
|
||||||
resolve_ids: true
|
resolve_ids: true
|
||||||
failure_mode: silent
|
failure_mode: silent
|
||||||
backlog_limit: 8196
|
backlog_limit: 8196
|
||||||
|
|
|
@ -29,16 +29,6 @@
|
||||||
macvlan_mode: bridge
|
macvlan_mode: bridge
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Show host facts
|
|
||||||
debug:
|
|
||||||
var: hostvars
|
|
||||||
|
|
||||||
- name: First ensure apt cache is always refreshed
|
|
||||||
apt:
|
|
||||||
update_cache: yes
|
|
||||||
when:
|
|
||||||
- ansible_pkg_mgr == 'apt'
|
|
||||||
|
|
||||||
- name: Ensure root ssh key
|
- name: Ensure root ssh key
|
||||||
user:
|
user:
|
||||||
name: "{{ ansible_env.USER | default('root') }}"
|
name: "{{ ansible_env.USER | default('root') }}"
|
||||||
|
@ -62,24 +52,6 @@
|
||||||
manage_dir: no
|
manage_dir: no
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: "systemd_networkd"
|
|
||||||
systemd_networkd_prefix: "elk_metrics_6x"
|
|
||||||
systemd_interface_cleanup: true
|
|
||||||
systemd_run_networkd: true
|
|
||||||
systemd_netdevs:
|
|
||||||
- NetDev:
|
|
||||||
Name: dummy0
|
|
||||||
Kind: dummy
|
|
||||||
- NetDev:
|
|
||||||
Name: br-mgmt
|
|
||||||
Kind: bridge
|
|
||||||
systemd_networks:
|
|
||||||
- interface: "dummy0"
|
|
||||||
bridge: "br-mgmt"
|
|
||||||
- interface: "br-mgmt"
|
|
||||||
address: "172.29.236.1"
|
|
||||||
netmask: "255.255.255.0"
|
|
||||||
|
|
||||||
- role: "nspawn_hosts"
|
- role: "nspawn_hosts"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
---
|
||||||
|
# Copyright 2018, Rackspace US, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
- name: Setup host keys
|
||||||
|
hosts: physical_hosts
|
||||||
|
connection: local
|
||||||
|
become: true
|
||||||
|
tasks:
|
||||||
|
- name: Ensure root ssh key
|
||||||
|
user:
|
||||||
|
name: "{{ ansible_env.USER | default('root') }}"
|
||||||
|
generate_ssh_key: "yes"
|
||||||
|
ssh_key_bits: 2048
|
||||||
|
ssh_key_file: ".ssh/id_rsa"
|
||||||
|
|
||||||
|
- name: Get root ssh key
|
||||||
|
slurp:
|
||||||
|
src: '~/.ssh/id_rsa.pub'
|
||||||
|
register: _root_ssh_key
|
||||||
|
|
||||||
|
- name: Prepare container ssh key fact
|
||||||
|
set_fact:
|
||||||
|
nspawn_container_ssh_key: "{{ _root_ssh_key['content'] | b64decode }}"
|
||||||
|
|
||||||
|
- name: Ensure public ssh key is in authorized_keys
|
||||||
|
authorized_key:
|
||||||
|
user: "{{ ansible_env.USER | default('root') }}"
|
||||||
|
key: "{{ nspawn_container_ssh_key }}"
|
||||||
|
manage_dir: no
|
|
@ -27,6 +27,10 @@
|
||||||
ANSIBLE_HOST_KEY_CHECKING: "False"
|
ANSIBLE_HOST_KEY_CHECKING: "False"
|
||||||
ANSIBLE_LOG_PATH: "/tmp/elk-metrics-6x-logs/ansible-elk-test.log"
|
ANSIBLE_LOG_PATH: "/tmp/elk-metrics-6x-logs/ansible-elk-test.log"
|
||||||
|
|
||||||
|
vars:
|
||||||
|
# inventory_file: "inventory/test-{{ (ansible_service_mgr == 'systemd') | ternary('container', 'metal') }}-inventory.yml"
|
||||||
|
inventory_file: "inventory/test-metal-inventory.yml"
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Create swap file
|
- name: Create swap file
|
||||||
command: "dd if=/dev/zero of=/swap.img bs=1M count=4096"
|
command: "dd if=/dev/zero of=/swap.img bs=1M count=4096"
|
||||||
|
@ -71,6 +75,12 @@
|
||||||
- "iptables -P OUTPUT ACCEPT"
|
- "iptables -P OUTPUT ACCEPT"
|
||||||
- "touch /tmp/elk-metrics-6x-logs/iptables.flushed"
|
- "touch /tmp/elk-metrics-6x-logs/iptables.flushed"
|
||||||
|
|
||||||
|
- name: First ensure apt cache is always refreshed
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
when:
|
||||||
|
- ansible_pkg_mgr == 'apt'
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Run embedded ansible installation
|
- name: Run embedded ansible installation
|
||||||
become: yes
|
become: yes
|
||||||
|
@ -94,33 +104,39 @@
|
||||||
- name: Run environment setup
|
- name: Run environment setup
|
||||||
become: yes
|
become: yes
|
||||||
become_user: root
|
become_user: root
|
||||||
command: "/root/ansible25/bin/ansible-playbook -i inventory/test-inventory.yml -e @test-vars.yml _container-setup.yml"
|
command: "/root/ansible25/bin/ansible-playbook -i {{ inventory_file }} -e @test-vars.yml _key-setup.yml"
|
||||||
environment:
|
environment:
|
||||||
ANSIBLE_ACTION_PLUGINS: "/root/ansible25/repositories/ansible-config_template/action"
|
ANSIBLE_ACTION_PLUGINS: "/root/ansible25/repositories/ansible-config_template/action"
|
||||||
ANSIBLE_CONNECTION_PLUGINS: "/root/ansible25/repositories/openstack-ansible-plugins/connection"
|
ANSIBLE_CONNECTION_PLUGINS: "/root/ansible25/repositories/openstack-ansible-plugins/connection"
|
||||||
ANSIBLE_LOG_PATH: "/tmp/elk-metrics-6x-logs/ansible-elk-test-container-setup.log"
|
ANSIBLE_LOG_PATH: "/tmp/elk-metrics-6x-logs/ansible-elk-test-container-setup.log"
|
||||||
args:
|
args:
|
||||||
chdir: "src/{{ current_test_repo }}/elk_metrics_6x/tests"
|
chdir: "src/{{ current_test_repo }}/elk_metrics_6x/tests"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr != 'systemd'
|
||||||
|
|
||||||
|
- name: Run environment setup
|
||||||
|
become: yes
|
||||||
|
become_user: root
|
||||||
|
command: "/root/ansible25/bin/ansible-playbook -i {{ inventory_file }} -e @test-vars.yml _container-setup.yml"
|
||||||
|
environment:
|
||||||
|
ANSIBLE_ACTION_PLUGINS: "/root/ansible25/repositories/ansible-config_template/action"
|
||||||
|
ANSIBLE_CONNECTION_PLUGINS: "/root/ansible25/repositories/openstack-ansible-plugins/connection"
|
||||||
|
ANSIBLE_LOG_PATH: "/tmp/elk-metrics-6x-logs/ansible-elk-test-container-setup.log"
|
||||||
|
args:
|
||||||
|
chdir: "src/{{ current_test_repo }}/elk_metrics_6x/tests"
|
||||||
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
- name: Wait 15 seconds
|
- name: Wait 15 seconds
|
||||||
command: "sleep 15"
|
command: "sleep 15"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
when:
|
||||||
- name: Log all facts
|
- ansible_service_mgr == 'systemd'
|
||||||
become: yes
|
|
||||||
become_user: root
|
|
||||||
command: "/root/ansible25/bin/ansible -m setup -i tests/inventory/test-inventory.yml all"
|
|
||||||
environment:
|
|
||||||
ANSIBLE_ACTION_PLUGINS: "/root/ansible25/repositories/ansible-config_template/action"
|
|
||||||
ANSIBLE_CONNECTION_PLUGINS: "/root/ansible25/repositories/openstack-ansible-plugins/connection"
|
|
||||||
ANSIBLE_LOG_PATH: "/tmp/elk-metrics-6x-logs/ansible-elk-test-facts.log"
|
|
||||||
args:
|
|
||||||
chdir: "src/{{ current_test_repo }}/elk_metrics_6x"
|
|
||||||
|
|
||||||
- name: Run functional test
|
- name: Run functional test
|
||||||
become: yes
|
become: yes
|
||||||
become_user: root
|
become_user: root
|
||||||
command: "/root/ansible25/bin/ansible-playbook -i tests/inventory/test-inventory.yml -e @tests/test-vars.yml site.yml"
|
command: "/root/ansible25/bin/ansible-playbook -i tests/{{ inventory_file }} -e @tests/test-vars.yml site.yml"
|
||||||
environment:
|
environment:
|
||||||
ANSIBLE_ACTION_PLUGINS: "/root/ansible25/repositories/ansible-config_template/action"
|
ANSIBLE_ACTION_PLUGINS: "/root/ansible25/repositories/ansible-config_template/action"
|
||||||
ANSIBLE_CONNECTION_PLUGINS: "/root/ansible25/repositories/openstack-ansible-plugins/connection"
|
ANSIBLE_CONNECTION_PLUGINS: "/root/ansible25/repositories/openstack-ansible-plugins/connection"
|
||||||
|
@ -131,7 +147,7 @@
|
||||||
- name: Show cluster state
|
- name: Show cluster state
|
||||||
become: yes
|
become: yes
|
||||||
become_user: root
|
become_user: root
|
||||||
command: "/root/ansible25/bin/ansible-playbook -i tests/inventory/test-inventory.yml -e @tests/test-vars.yml showElasticCluster.yml"
|
command: "/root/ansible25/bin/ansible-playbook -i tests/{{ inventory_file }} -e @tests/test-vars.yml showElasticCluster.yml"
|
||||||
environment:
|
environment:
|
||||||
ANSIBLE_ACTION_PLUGINS: "/root/ansible25/repositories/ansible-config_template/action"
|
ANSIBLE_ACTION_PLUGINS: "/root/ansible25/repositories/ansible-config_template/action"
|
||||||
ANSIBLE_CONNECTION_PLUGINS: "/root/ansible25/repositories/openstack-ansible-plugins/connection"
|
ANSIBLE_CONNECTION_PLUGINS: "/root/ansible25/repositories/openstack-ansible-plugins/connection"
|
||||||
|
|
|
@ -10,11 +10,12 @@ hosts:
|
||||||
ansible_user: root
|
ansible_user: root
|
||||||
vars:
|
vars:
|
||||||
physical_host: localhost
|
physical_host: localhost
|
||||||
|
management_cidr: "172.29.236.0/24"
|
||||||
container_networks:
|
container_networks:
|
||||||
management_address:
|
management_address:
|
||||||
address: "172.29.236.1"
|
address: "172.29.236.1"
|
||||||
netmask: "255.255.255.0"
|
netmask: "255.255.255.0"
|
||||||
bridge: "br-mgmt"
|
bridge: "{{ hostvars[physical_host]['ansible_default_ipv4']['alias'] }}"
|
||||||
|
|
||||||
|
|
||||||
all_containers:
|
all_containers:
|
||||||
|
@ -25,7 +26,7 @@ all_containers:
|
||||||
management_address:
|
management_address:
|
||||||
address: "{{ ansible_host }}"
|
address: "{{ ansible_host }}"
|
||||||
netmask: "255.255.255.0"
|
netmask: "255.255.255.0"
|
||||||
bridge: "br-mgmt"
|
bridge: "{{ hostvars[physical_host]['ansible_default_ipv4']['alias'] }}"
|
||||||
|
|
||||||
children:
|
children:
|
||||||
elastic-logstash:
|
elastic-logstash:
|
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
# The hosts group is used to target physical host machines. Enter all physical
|
||||||
|
# host machines here.
|
||||||
|
hosts:
|
||||||
|
children:
|
||||||
|
physical_hosts:
|
||||||
|
hosts:
|
||||||
|
localhost:
|
||||||
|
ansible_host: 127.0.0.1
|
||||||
|
ansible_user: root
|
||||||
|
vars:
|
||||||
|
physical_host: localhost
|
||||||
|
|
||||||
|
elastic-logstash:
|
||||||
|
hosts:
|
||||||
|
localhost: {}
|
||||||
|
|
||||||
|
kibana:
|
||||||
|
hosts:
|
||||||
|
localhost: {}
|
||||||
|
|
||||||
|
apm-server:
|
||||||
|
hosts:
|
||||||
|
localhost: {}
|
|
@ -10,7 +10,7 @@ if [[ ! -d "/tmp/elk-metrics-6x-logs" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "To build a test environment run the following:"
|
echo "To build a test environment run the following:"
|
||||||
echo -e "# /root/ansible25/bin/ansible-playbook -i tests/inventory/test-inventory.yml tests/test.yml --limit localhost\n"
|
echo -e "# /root/ansible25/bin/ansible-playbook -i tests/inventory/test-container-inventory.yml tests/test.yml --limit localhost\n"
|
||||||
|
|
||||||
echo "Run manual functional tests by executing the following:"
|
echo "Run manual functional tests by executing the following:"
|
||||||
echo -e "# /root/ansible25/bin/ansible-playbook -i tests/inventory/test-inventory.yml site.yml\n"
|
echo -e "# /root/ansible25/bin/ansible-playbook -i tests/inventory/test-container-inventory.yml site.yml\n"
|
||||||
|
|
|
@ -22,6 +22,3 @@ q_mem: 128
|
||||||
h_mem: 512
|
h_mem: 512
|
||||||
|
|
||||||
osa_test_repo: "openstack/openstack-ansible-ops"
|
osa_test_repo: "openstack/openstack-ansible-ops"
|
||||||
|
|
||||||
# Set the data interface to a known value
|
|
||||||
elastic_data_interface: "{{ (inventory_hostname == 'localhost') | ternary('mv-mgmt', 'mv-mv-mgmt') }}"
|
|
||||||
|
|
|
@ -36,6 +36,12 @@
|
||||||
# nodeset: opensuse-423
|
# nodeset: opensuse-423
|
||||||
# voting: false
|
# voting: false
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: "openstack-ansible-ops:elk_metrics_6x-ubuntu-trusty"
|
||||||
|
parent: "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
|
||||||
|
nodeset: ubuntu-trusty
|
||||||
|
voting: false
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: "openstack-ansible-ops:elk_metrics_6x-ubuntu-bionic"
|
name: "openstack-ansible-ops:elk_metrics_6x-ubuntu-bionic"
|
||||||
parent: "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
|
parent: "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
- openstack-ansible-role-jobs
|
- openstack-ansible-role-jobs
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
|
- "openstack-ansible-ops:elk_metrics_6x-ubuntu-trusty"
|
||||||
- "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
|
- "openstack-ansible-ops:elk_metrics_6x-ubuntu-xenial"
|
||||||
- "openstack-ansible-ops:elk_metrics_6x-ubuntu-bionic"
|
- "openstack-ansible-ops:elk_metrics_6x-ubuntu-bionic"
|
||||||
gate:
|
gate:
|
||||||
|
|
Loading…
Reference in New Issue