Skip to content

Commit

Permalink
Merge pull request #4 from conjur-cookbooks/feature/rhel7-support
Browse files Browse the repository at this point in the history
Systemd support for CentOS 7 support (tested manually on Vagrant)
  • Loading branch information
Matthew Cincotti committed Dec 21, 2015
2 parents 24cd84a + 98f8385 commit f75ca4a
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 5 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 0.3.0

* Systemd support

# 0.2.3

* Updated EL repository URL

# 0.2.2

* Add a timeout in pubkey fetcher to prevent lockout when Conjur is unreachable

# 0.2.1

* Lower nslcd's idle_timelimit to one second
Expand Down
9 changes: 6 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ end

desc "Package cookbooks into a chef-solo tarball"
task :package => :vendor do
`rm -rf vendor/cookbooks/conjur`
`mkdir -p vendor/cookbooks/conjur`
`cp -r metadata.rb Berksfile Berksfile.lock CHANGELOG.md chefignore README.md attributes recipes spec vendor/cookbooks/conjur`
version=`git describe --tags`.strip
`cp -r metadata.rb Berksfile Berksfile.lock CHANGELOG.md chefignore \
README.md attributes recipes files templates libraries \
vendor/cookbooks/conjur`
version=`git describe --tags --dirty`.strip
Dir.chdir 'vendor'
tarball = "conjur-#{version}.tar.gz"
puts "Building cookbook tarball #{tarball}"
`tar czf ../#{tarball} cookbooks`
`tar czv --numeric-owner --owner=0 --group=root --mode=og+r -f ../#{tarball} cookbooks`
end
18 changes: 18 additions & 0 deletions files/default/systemd/logshipper.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=Conjur log shipping service
Documentation=https://developer.conjur.net
Wants=rsyslog.service
Before=rsyslog.service

[Service]
ExecStartPre=-/bin/rm /var/run/logshipper
ExecStartPre=/bin/mkfifo --context --mode 0460 /var/run/logshipper
ExecStartPre=/bin/chown logshipper /var/run/logshipper
ExecStart=/usr/sbin/logshipper -n /var/run/logshipper
Restart=always
User=logshipper
Group=conjur
PermissionsStartOnly=true

[Install]
RequiredBy=rsyslog.service
2 changes: 2 additions & 0 deletions libraries/conjur_helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module ConjurDetect
def self.detect_init
if test 'x', '/sbin/runit'
'runit'
elsif test 'x', '/usr/bin/systemctl'
'systemd'
else
'upstart'
end
Expand Down
4 changes: 2 additions & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
maintainer_email 'support@conjur.net'
license 'MIT License'
description 'Installs/Configures conjur'
version '0.2.2'
version '0.3.0'

recipe "conjur::install", "Installs Conjur base packages and configuration, suitable for a foundation image."

depends "apt"
depends "yum"
depends "sshd-service"

%w(ubuntu).each do |platform|
%w(ubuntu centos).each do |platform|
supports platform
end
13 changes: 13 additions & 0 deletions recipes/_install_logshipper_systemd.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cookbook_file '/etc/systemd/system/logshipper.service' do
source 'systemd/logshipper.service'
owner 'root'
group 'root'
mode '0644'
end

bash 'enable and run logshipper' do
code """
systemctl enable logshipper
systemctl restart rsyslog
"""
end

0 comments on commit f75ca4a

Please sign in to comment.