Skip to content

Commit

Permalink
Fix lots of issues reported by ansible-lint
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
abalage committed Dec 10, 2021
1 parent 70cbc08 commit d98cae2
Show file tree
Hide file tree
Showing 19 changed files with 132 additions and 133 deletions.
70 changes: 35 additions & 35 deletions roles/filebeat/tasks/filebeat_podman.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
- name: Deploy Filebeat in a pod
vars:
pod_name: "{{ filebeat_pod_name }}.{{inventory_hostname_short}}.filebeat_{{ filebeat.instance_name }}"
pod_name: "{{ filebeat_pod_name }}.{{ inventory_hostname_short }}.filebeat_{{ filebeat.instance_name }}"
block:
- name: Create pod for filebeat
containers.podman.podman_pod:
name: "{{ pod_name }}"
hostname: "{{inventory_hostname_short}}.filebeat_{{ filebeat.instance_name }}"
hostname: "{{ inventory_hostname_short }}.filebeat_{{ filebeat.instance_name }}"
state: "{{ state }}"
recreate: "{{ recreate }}"
network: "{{filebeat_pod_network}}"
network: "{{ filebeat_pod_network }}"
when: filebeat_pod_network != "bridge"

- name: Create pod for filebeat
containers.podman.podman_pod:
name: "{{ pod_name }}"
hostname: "{{inventory_hostname_short}}.filebeat_{{ filebeat.instance_name }}"
hostname: "{{ inventory_hostname_short }}.filebeat_{{ filebeat.instance_name }}"
state: "{{ state }}"
recreate: "{{ recreate }}"
network: "{{ filebeat_pod_network }}"
Expand All @@ -24,32 +24,32 @@

- name: Run Filebeat-setup container to perform initial setup. It will exit when it's done.
podman_container:
name: "{{inventory_hostname_short}}.filebeat_{{ filebeat.instance_name }}"
name: "{{ inventory_hostname_short }}.filebeat_{{ filebeat.instance_name }}"
pod: "{{ pod_name }}"
image: "{{ filebeat_image }}:{{ filebeat_version }}"
command: setup -e --index-management --pipelines --dashboards
state: "{{ state }}"
user: root
recreate: "{{ recreate }}"
network: "{{filebeat_pod_network}}"
## by default json loggin is used plus filebeat
## log driver k8s-file
#log_driver: k8s-file
#log_opt:
# path: "{{ filebeat_data }}/logs/filebeat-container.log"
# max_size: 300mb
## log driver to journald (where syslog-ng can pick-up)
#log_driver: journald
#log_opt:
# tag=filebeat|{{ '{{' }}.ImageName{{ '}}' }}|podman
network: "{{ filebeat_pod_network }}"
# # by default json loggin is used plus filebeat
# # log driver k8s-file
# log_driver: k8s-file
# log_opt:
# path: "{{ filebeat_data }}/logs/filebeat-container.log"
# max_size: 300mb
# # log driver to journald (where syslog-ng can pick-up)
# log_driver: journald
# log_opt:
# tag=filebeat|{{ '{{' }}.ImageName{{ '}}' }}|podman
label:
process: filebeat-setup
expose: "{{filebeat.ports}}"
memory: "{{filebeat.memory_limit}}"
cpus: "{{filebeat.cpu_limit}}"
expose: "{{ filebeat.ports }}"
memory: "{{ filebeat.memory_limit }}"
cpus: "{{ filebeat.cpu_limit }}"
env:
TZ: "{{ timezone }}"
NO_PROXY: "{{no_proxy}}"
NO_PROXY: "{{ no_proxy }}"
volume:
- "{{ filebeat_config }}/certs/http_ca.crt:/usr/share/filebeat/config/http_ca.crt:ro,z"
- "{{ filebeat_config }}/certs/kibana_signing_ca.crt:/usr/share/filebeat/config/kibana_signing_ca.crt:ro,z"
Expand All @@ -64,28 +64,28 @@

- name: Run Filebeat container
podman_container:
name: "{{inventory_hostname_short}}.filebeat_{{ filebeat.instance_name }}"
name: "{{ inventory_hostname_short }}.filebeat_{{ filebeat.instance_name }}"
pod: "{{ pod_name }}"
image: "{{ filebeat_image }}:{{ filebeat_version }}"
state: "{{ state }}"
user: root
recreate: "{{ recreate }}"
network: "{{filebeat_pod_network}}"
## by default json loggin is used plus filebeat
## log driver k8s-file
#log_driver: k8s-file
#log_opt:
# path: "{{ filebeat_data }}/logs/filebeat-container.log"
# max_size: 300mb
## log driver to journald (where syslog-ng can pick-up)
#log_driver: journald
#log_opt:
# tag=filebeat|{{ '{{' }}.ImageName{{ '}}' }}|podman
network: "{{ filebeat_pod_network }}"
# # by default json loggin is used plus filebeat
# # log driver k8s-file
# log_driver: k8s-file
# log_opt:
# path: "{{ filebeat_data }}/logs/filebeat-container.log"
# max_size: 300mb
# # log driver to journald (where syslog-ng can pick-up)
# log_driver: journald
# log_opt:
# tag=filebeat|{{ '{{' }}.ImageName{{ '}}' }}|podman
label:
process=filebeat
expose: "{{filebeat.ports}}"
memory: "{{filebeat.memory_limit}}"
cpus: "{{filebeat.cpu_limit}}"
expose: "{{ filebeat.ports }}"
memory: "{{ filebeat.memory_limit }}"
cpus: "{{ filebeat.cpu_limit }}"
env:
TZ: "{{ timezone }}"
volume:
Expand Down
1 change: 1 addition & 0 deletions roles/filebeat/tasks/generatetemplates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
dest: "{{ filebeat_config }}/config/filebeat.yml"
group: "root"
owner: "root"
mode: "0644"
4 changes: 2 additions & 2 deletions roles/filebeat/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
include_vars:
file: "../../logstash/defaults/main.yml"
tags:
- create_dirs
- includevars
- create_dirs
- includevars

- name: Import createdirs
include_tasks:
Expand Down
2 changes: 1 addition & 1 deletion roles/kibana/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
# handlers file for kibana
# handlers file for kibana
6 changes: 3 additions & 3 deletions roles/kibana/tasks/createdirs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
group: "1000"
mode: '0755'
loop:
- "{{kibana_config}}/config"
- "{{kibana_config}}/certs"
- "{{kibana_data}}/logs"
- "{{ kibana_config }}/config"
- "{{ kibana_config }}/certs"
- "{{ kibana_data }}/logs"
36 changes: 18 additions & 18 deletions roles/kibana/tasks/kibana_podman.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
- name: Deploy Kibana in a pod
vars:
pod_name: "{{ kibana_pod_name }}.{{inventory_hostname_short}}.kibana_{{ kibana.instance_name }}"
pod_name: "{{ kibana_pod_name }}.{{ inventory_hostname_short }}.kibana_{{ kibana.instance_name }}"
block:
- name: Create pod for kibana
containers.podman.podman_pod:
name: "{{ pod_name }}"
hostname: "{{inventory_hostname_short}}.kibana_{{ kibana.instance_name }}"
hostname: "{{ inventory_hostname_short }}.kibana_{{ kibana.instance_name }}"
state: "{{ state }}"
recreate: "{{ recreate }}"
network: "{{kibana_pod_network}}"
network: "{{ kibana_pod_network }}"
when: kibana_pod_network != "bridge"

- name: Create pod for kibana
containers.podman.podman_pod:
name: "{{ pod_name }}"
hostname: "{{inventory_hostname_short}}.kibana_{{ kibana.instance_name }}"
hostname: "{{ inventory_hostname_short }}.kibana_{{ kibana.instance_name }}"
state: "{{ state }}"
recreate: "{{ recreate }}"
network: "{{ kibana_pod_network }}"
Expand All @@ -24,22 +24,22 @@

- name: Run Kibana container
podman_container:
name: "{{inventory_hostname_short}}.kibana_{{ kibana.instance_name }}"
name: "{{ inventory_hostname_short }}.kibana_{{ kibana.instance_name }}"
pod: "{{ pod_name }}"
image: "{{ kibana_image }}:{{ kibana_version }}"
state: "{{ state }}"
recreate: "{{ recreate }}"
network: "{{kibana_pod_network}}"
## by default json loggin is used plus filebeat
## log driver k8s-file
#log_driver: k8s-file
#log_opt:
# path: "{{ kibana_data }}/logs/kibana-container.log"
# max_size: 300mb
## log driver to journald (where syslog-ng can pick-up)
#log_driver: journald
#log_opt:
# tag=kibana|{{ '{{' }}.ImageName{{ '}}' }}|podman
network: "{{ kibana_pod_network }}"
# # by default json loggin is used plus filebeat
# # log driver k8s-file
# log_driver: k8s-file
# log_opt:
# path: "{{ kibana_data }}/logs/kibana-container.log"
# max_size: 300mb
# # log driver to journald (where syslog-ng can pick-up)
# log_driver: journald
# log_opt:
# tag=kibana|{{ '{{' }}.ImageName{{ '}}' }}|podman
label:
process=kibana
traefik.enable=true
Expand All @@ -50,8 +50,8 @@
traefik.http.services.kibana-www-service.loadbalancer.server.scheme=https
traefik.http.services.kibana-www-service.loadbalancer.server.port={{ kibana.ports[0] }}
expose: "{{ kibana.ports }}"
memory: "{{kibana.memory_limit}}"
cpus: "{{kibana.cpu_limit}}"
memory: "{{ kibana.memory_limit }}"
cpus: "{{ kibana.cpu_limit }}"
volume:
- "{{ kibana_data }}/logs:/var/log/kibana:z"
- "{{ kibana_config }}/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro,z"
Expand Down
2 changes: 1 addition & 1 deletion roles/kibana/tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- hosts: localhost
remote_user: root
roles:
- kibana
- kibana
2 changes: 1 addition & 1 deletion roles/kibana/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
# vars file for kibana
# vars file for kibana
36 changes: 18 additions & 18 deletions roles/logstash/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,24 @@ logstash:
- "9601"

logstash_pipelines:
- name: arcsight
type: arcsight
id: "001"
enabled: False
input_port: "7500"
pipeline_workers: "1"
output_user: logstash_internal
output_password: "{{logstash_internal_password}}"
output_index: "arcsight-%{+YYYY.MM.dd}"
- name: beats
type: beats
id: "001"
enabled: False
input_port: "5045"
pipeline_workers: "1"
output_user: logstash_internal
output_password: "{{logstash_internal_password}}"
output_index: '%{[@metadata][beat]}-%{[@metadata][version]}'
- name: arcsight
type: arcsight
id: "001"
enabled: false
input_port: "7500"
pipeline_workers: "1"
output_user: logstash_internal
output_password: "{{logstash_internal_password}}"
output_index: "arcsight-%{+YYYY.MM.dd}"
- name: beats
type: beats
id: "001"
enabled: false
input_port: "5045"
pipeline_workers: "1"
output_user: logstash_internal
output_password: "{{logstash_internal_password}}"
output_index: '%{[@metadata][beat]}-%{[@metadata][version]}'

xpack_http_ca: "{{ vault_xpack_http_ca }}"
# logstash does not support pkcs12 but only pkcs8
Expand Down
6 changes: 2 additions & 4 deletions roles/logstash/tasks/generatetemplates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
mode: "0644"
owner: "1000"
group: "1000"
when: item.enabled == True
when: item.enabled
loop: "{{ logstash_pipelines }}"

- name: Generate log4j2.properties for Logstash node
Expand All @@ -28,6 +28,4 @@
dest: "{{ logstash_config }}/config/log4j2.properties"
group: "1000"
owner: "1000"



mode: "0644"
40 changes: 20 additions & 20 deletions roles/logstash/tasks/logstash_podman.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
- name: Deploy Logstash in a pod
vars:
pod_name: "{{ logstash_pod_name }}.{{inventory_hostname_short}}.logstash_{{ logstash.instance_name }}"
pod_name: "{{ logstash_pod_name }}.{{ inventory_hostname_short }}.logstash_{{ logstash.instance_name }}"
block:
- name: Create pod for logstash
containers.podman.podman_pod:
name: "{{ pod_name }}"
hostname: "{{inventory_hostname_short}}.logstash_{{ logstash.instance_name }}"
hostname: "{{ inventory_hostname_short }}.logstash_{{ logstash.instance_name }}"
state: "{{ state }}"
recreate: "{{ recreate }}"
network: "{{logstash_pod_network}}"
network: "{{ logstash_pod_network }}"
when: logstash_pod_network != "bridge"

- name: Create pod for logstash
containers.podman.podman_pod:
name: "{{ pod_name }}"
hostname: "{{inventory_hostname_short}}.logstash_{{ logstash.instance_name }}"
hostname: "{{ inventory_hostname_short }}.logstash_{{ logstash.instance_name }}"
state: "{{ state }}"
recreate: "{{ recreate }}"
network: "{{ logstash_pod_network }}"
Expand All @@ -24,31 +24,31 @@

- name: Run Logstash container
podman_container:
name: "{{inventory_hostname_short}}.logstash_{{ logstash.instance_name }}"
name: "{{ inventory_hostname_short }}.logstash_{{ logstash.instance_name }}"
pod: "{{ pod_name }}"
image: "{{ logstash_image }}:{{ logstash_version }}"
state: "{{ state }}"
recreate: "{{ recreate }}"
network: "{{logstash_pod_network}}"
## by default json loggin is used plus filebeat
## log driver k8s-file
#log_driver: k8s-file
#log_opt:
# path: "{{ logstash_data }}/logs/logstash-container.log"
# max_size: 300mb
## log driver to journald (where syslog-ng can pick-up)
#log_driver: journald
#log_opt:
# tag=logstash|{{ '{{' }}.ImageName{{ '}}' }}|podman
network: "{{ logstash_pod_network }}"
# # by default json loggin is used plus filebeat
# # log driver k8s-file
# log_driver: k8s-file
# log_opt:
# path: "{{ logstash_data }}/logs/logstash-container.log"
# max_size: 300mb
# # log driver to journald (where syslog-ng can pick-up)
# log_driver: journald
# log_opt:
# tag=logstash|{{ '{{' }}.ImageName{{ '}}' }}|podman
label:
process: logstash
memory: "{{logstash.memory_limit}}"
cpus: "{{logstash.cpu_limit}}"
memory: "{{ logstash.memory_limit }}"
cpus: "{{ logstash.cpu_limit }}"
expose: "{{ logstash.ports }}"
env:
TZ: "{{ timezone }}"
LS_JAVA_OPTS: "{{logstash.java_opts}}"
NO_PROXY: "{{no_proxy}}"
LS_JAVA_OPTS: "{{ logstash.java_opts }}"
NO_PROXY: "{{ no_proxy }}"
volume:
- "{{ logstash_config }}/certs:/usr/share/logstash/certs:ro,z"
- "{{ logstash_config }}/config/log4j2.properties:/usr/share/logstash/config/log4j2.properties:z"
Expand Down
4 changes: 2 additions & 2 deletions roles/metricbeat/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sudo: false
addons:
apt:
packages:
- python-pip
- python-pip

install:
# Install ansible
Expand All @@ -26,4 +26,4 @@ script:
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks: https://galaxy.ansible.com/api/v1/notifications/
2 changes: 1 addition & 1 deletion roles/metricbeat/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
# handlers file for metricbeat
# handlers file for metricbeat
2 changes: 1 addition & 1 deletion roles/metricbeat/tasks/createdirs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
- "{{ metricbeat_config }}/certs"
- "{{ metricbeat_config }}/config"
tags:
- create_dirs
- create_dirs
Loading

0 comments on commit d98cae2

Please sign in to comment.