-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Versioning, reflected in pillar.example #3
base: master
Are you sure you want to change the base?
Changes from all commits
caf86d6
ba2bbe8
c28c185
8036668
064319e
e5030be
278c923
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
driver: | ||
name: docker | ||
use_sudo: false | ||
privileged: true | ||
|
||
provisioner: | ||
name: salt_solo | ||
formula: beats | ||
salt_install: bootstrap | ||
salt_bootstrap_options: -X stable | ||
salt_bootstrap_url: https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | ||
require_chef: false | ||
state_top: | ||
base: | ||
"*": | ||
- beats.repository | ||
- beats.filebeat.install | ||
- beats.filebeat.config | ||
- beats.filebeat.service | ||
- beats.filebeat.purge | ||
- beats.metricbeat.install | ||
- beats.metricbeat.config | ||
- beats.metricbeat.service | ||
- beats.metricbeat.purge | ||
- beats.purge | ||
|
||
platforms: | ||
- name: debian-jessie | ||
- name: ubuntu-14.04 | ||
- name: ubuntu-16.04 | ||
- name: centos-6 | ||
- name: centos-7 | ||
driver_config: | ||
run_command: /usr/lib/systemd/systemd | ||
|
||
suites: | ||
- name: default |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
sudo: required | ||
|
||
language: ruby | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
- pip install -r requirements.txt | ||
|
||
script: bundle exec kitchen verify |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "test-kitchen" | ||
gem "kitchen-docker" | ||
gem "kitchen-salt" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.2 | ||
0.0.3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
include: | ||
- beats.filebeat.install | ||
|
||
{% if salt['pillar.get']('beats:filebeat:config', {}) %} | ||
/etc/filebeat/filebeat.yml: | ||
file.serialize: | ||
- dataset_pillar: 'beats:filebeat:config' | ||
- formatter: yaml | ||
- require: | ||
- sls: beats.filebeat.install | ||
{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
include: | ||
- beats.filebeat.install | ||
- beats.filebeat.config | ||
|
||
# Enable and run Filebeat daemon | ||
filebeat_running: | ||
service.running: | ||
- name: filebeat | ||
enable: True | ||
require: | ||
- sls: beats.filebeat.install | ||
{%- if salt['pillar.get']('beats:filebeat:config') %} | ||
- sls: beats.filebeat.config | ||
watch: | ||
- file: /etc/filebeat/filebeat.yml | ||
{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
include: | ||
- beats.metricbeat.install | ||
|
||
{% if salt['pillar.get']('beats:metricbeat:config', {}) %} | ||
/etc/metricbeat/metricbeat.yml: | ||
file.serialize: | ||
- dataset_pillar: 'beats:metricbeat:config' | ||
- formatter: yaml | ||
- require: | ||
- sls: beats.metricbeat.install | ||
{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,6 @@ include: | |
metricbeat_install: | ||
pkg.installed: | ||
- name: metricbeat | ||
- version: {{ salt['pillar.get']('beats:metricbeat:version', '6.1.2') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not something like that? [...]
{% if beats.metricbeat.version is defined %}
- version: {{ salt['pillar.get']('beats:metricbeat:version') }}
{% endif %}
[...] If specified within the pillar, the version will be enforced. If not, the latest version of the package will be installed |
||
- require: | ||
- sls: beats.repository | ||
|
||
# Enable the metricbeat systemd unit | ||
metricbeat_enabled: | ||
service.enabled: | ||
- name: metricbeat | ||
- require: | ||
- pkg: metricbeat_install |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
include: | ||
- beats.metricbeat.install | ||
- beats.metricbeat.config | ||
|
||
# Enable and run Metricbeat daemon | ||
metricbeat_running: | ||
service.running: | ||
- name: metricbeat | ||
enable: True | ||
require: | ||
- sls: beats.metricbeat.install | ||
{%- if salt['pillar.get']('beats:metricbeat:config') %} | ||
- sls: beats.metricbeat.config | ||
watch: | ||
- file: /etc/metricbeat/metricbeat.yml | ||
{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
beats: | ||
filebeat: | ||
version: latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think using |
||
config: | ||
filebeat.prospectors: | ||
- input_type: log | ||
|
@@ -14,6 +15,7 @@ beats: | |
rotateeverybytes: 10485760 | ||
keepfiles: 7 | ||
metricbeat: | ||
version: latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think using |
||
config: | ||
cbeat.config.modules: | ||
path: ${path.config}/conf.d/*.yml | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
testinfra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not something like that?
If specified within the pillar, the version will be enforced. If not, the latest version of the package will be installed