redis::server thinks that OracleLinux 6 has systemd #136
Description
I just started using this module, so this may be answered somewhere else that I have found yet. But, in the case that this hasn't been documented yet, here's what's happening to me:
Environment:
- $::operatingsystem => OracleLinux
- $::operatingsystemmajrelease => 6
- Puppet version => 4.10.10
- mod 'dwerder-redis', '2.1.0'
Manifest where I'm using your module:
class {'redis::install':
redis_build_dir => '/opt',
redis_user => 'apache',
redis_group => 'webadmin',
}
redis::server {'webapps':
redis_memory => '512mb',
redis_ip => '127.0.0.1',
redis_port => 6379,
redis_nr_dbs => 16,
running => true,
enabled => true,
}
Error message being presented:
Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - /usr/lib/systemd/system/redis-server_webapps.service20180403-41151-wnw22o.lock at /etc/puppetlabs/code/environments/pg_alter_redis/modules/redis/manifests/server.pp:235
I looked into the code in this repository at manifests/server.pp, and line 235 is inside a file declaration for $service_file. That variable, along with $has_systemd, gets defined in a case block in lines 200-223. The relevant section:
'Fedora', 'RedHat', 'CentOS', 'OEL', 'OracleLinux', 'Amazon', 'Scientific': {
if versioncmp($::operatingsystemmajrelease, '7') >= 0 {
$has_systemd = true
$service_file = "/usr/lib/systemd/system/redis-server_${redis_name}.service"
}
}
So, to my untrained eye, it appears that the OracleLinux 6 VM is being interpreted by this case statement to have a major version of 7 and thus $has_systemd is getting set to true
and then it's trying to create $service_file when it shouldn't.
Do you have any insight on what might be happening, or how to resolve it? Thanks!