-
Notifications
You must be signed in to change notification settings - Fork 2
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
Specify zabbix version #3
base: master
Are you sure you want to change the base?
Changes from all commits
a4941fe
5dfade0
0527b25
8bb608e
b308c3d
6826e26
035d5d6
f4e1d73
0620903
b8223e2
7e342d1
c63b3a9
0ebf3bd
1b0fb6f
5c292b2
bd46766
450ee08
267a663
f29e5f5
644e132
bb1aea2
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,9 @@ | ||
source 'https://supermarket.chef.io' | ||
|
||
metadata | ||
|
||
group :integration do | ||
cookbook 'apt' | ||
cookbook 'sudo' | ||
cookbook 'selinux' | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
license 'GNU Public License 3.0' | ||
description 'Installs/Configures zabbix_ng' | ||
long_description 'Installs/Configures zabbix_ng' | ||
version '0.1.1' | ||
version '0.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. Please do not change the cookbook version - I think it's usually a good idea to let the maintainer take care of this. Can you remove this from the PR? |
||
depends 'apt' | ||
depends 'sudo' | ||
|
||
depends 'yum' | ||
depends 'yum-epel' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,9 @@ | |
|
||
include_recipe 'zabbix_ng::repository' | ||
|
||
package 'zabbix-agent' | ||
package 'zabbix-agent' do | ||
version node['zabbix_ng']['version'] | ||
end | ||
|
||
template '/etc/zabbix/zabbix_agentd.conf' do | ||
mode 00644 | ||
|
@@ -35,6 +37,11 @@ | |
# aptitude is required to get available update count | ||
package 'aptitude' | ||
|
||
directory '/etc/zabbix/zabbix_agentd.d' do | ||
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. On my machines, this directory is maintained by the apt packages. I suppose it doesn't hurt to re-define it here though. Wasn't it created in your tests? |
||
mode 00644 | ||
recursive true | ||
end | ||
|
||
template '/etc/zabbix/zabbix_agentd.d/apt.conf' do | ||
owner 'root' | ||
group 'root' | ||
|
@@ -43,8 +50,7 @@ | |
source 'agent/apt.conf.erb' | ||
end | ||
|
||
when 'rhel', 'fedora' | ||
# TODO: yum repository is currently not supported anyway | ||
when 'rhel' | ||
template '/etc/zabbix/zabbix_agentd.d/yum.conf' do | ||
owner 'root' | ||
group 'root' | ||
|
@@ -57,9 +63,9 @@ | |
service 'zabbix-agent' do | ||
case node['platform_family'] | ||
when 'debian' | ||
subscribes :restart, 'template[/etc/zabbix/zabbix_agentd.d/yum.conf]' | ||
when 'rhel', 'fedora' | ||
subscribes :restart, 'template[/etc/zabbix/zabbix_agentd.d/apt.conf]' | ||
when 'rhel' | ||
subscribes :restart, 'template[/etc/zabbix/zabbix_agentd.d/yum.conf]' | ||
end | ||
|
||
subscribes :restart, 'template[/etc/zabbix/zabbix_agentd.conf' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,29 @@ | |
# | ||
|
||
# Official Zabbix repository | ||
apt_repository 'zabbix' do | ||
uri 'http://repo.zabbix.com/zabbix/2.4/ubuntu' | ||
distribution node['lsb']['codename'] | ||
components %w(main) | ||
key 'http://repo.zabbix.com/zabbix-official-repo.key' | ||
case node['platform'] | ||
when 'debian' | ||
apt_repository 'zabbix' do | ||
uri node['zabbix_ng']['repository']['uri'] | ||
distribution node['lsb']['codename'] | ||
components %w(main) | ||
key node['zabbix_ng']['repository']['key'] | ||
end | ||
when 'ubuntu' | ||
apt_repository 'zabbix' do | ||
uri node['zabbix_ng']['repository']['uri'] | ||
distribution node['lsb']['codename'] | ||
components %w(main) | ||
key node['zabbix_ng']['repository']['key'] | ||
end | ||
when 'redhat', 'centos', 'fedora' | ||
yum_repository 'zabbix' do | ||
description "Official zabbix repository" | ||
baseurl node['zabbix_ng']['repository']['uri'] | ||
gpgkey node['zabbix_ng']['repository']['key'] | ||
end | ||
include_recipe 'yum-epel' | ||
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. Maybe a default case should be inserted, which prints some sort of error message if this cookbook is run on a platform that is not supported? |
||
end | ||
|
||
|
||
|
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.
I do not think it's a good idea to version-lock repository packages. This will break as soon as there is a minor update or security fix.
For Ubuntu, the major version is specified using the repository URL, which is fine I think. Does this work differently on RHEL, or what was the reason you included this?