Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modules/tripwire/manifests/init.pp
- #= Class: tripwire
- #
- # Manages tripwire
- #
- #= Usage:
- # include tripwire (in default nodes)
- #
- # Notes:
- #- Loads TWeagent rpm
- #- Copies in a chkconfig aware variation of /etc/init.d/twdaemon
- #- Runs a configuration script
- #
- class tripwire (
- $servername = '',
- $port = '',
- $password = '',
- ) {
- include stdlib
- package { 'TWeagent':
- ensure => 'installed'
- }
- exec { 'configureTripwire':
- command => "/usr/local/tripwire/te/agent/bin/twconfig postInstallConfig --server-host ${servername} --server-port ${port} --passphrase ${password}",
- unless => '/bin/grep -qF chkconfig /etc/init.d/twdaemon',
- require => Package['TWeagent'],
- }
- file { '/etc/init.d/twdaemon':
- ensure => present,
- path => '/etc/init.d/twdaemon',
- mode => '0744',
- owner => 'root',
- group => 'root',
- require => Exec['configureTripwire'],
- source => 'puppet:///modules/tripwire/chkconfigAware-twdaemon'
- }
- service { 'twdaemon':
- ensure => 'running',
- enable => true,
- hasstatus => true,
- hasrestart => true,
- require => File['/etc/init.d/twdaemon'],
- }
- $tw_servers = hiera_hash ( 'tripwire_servers', {} )
- if ! empty( $tw_servers ) {
- create_resources ( tripwire::server, $tw_servers )
- }
- }
- modules/tripwire/files/chkconfigAware-twdaemon
- #!/bin/sh
- #
- # chkconfig: 235 95 95
- # description: Tripwire daemon
- #
- /usr/local/tripwire/te/agent/bin/twdaemon "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement