mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	puppet: Fix zuli-redis.conf path typo.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							79cae1e7e0
						
					
				
				
					commit
					6749810c2e
				
			| @@ -19,20 +19,40 @@ class zulip::redis { | |||||||
|   package { $redis_packages: ensure => 'installed' } |   package { $redis_packages: ensure => 'installed' } | ||||||
|  |  | ||||||
|   $file = "${redis_dir}/redis.conf" |   $file = "${redis_dir}/redis.conf" | ||||||
|   $zulip_redisconf = "${redis_dir}/zuli-redis.conf" |   $zulip_redisconf = "${redis_dir}/zulip-redis.conf" | ||||||
|   $line = "include ${zulip_redisconf}" |   $line = "include ${zulip_redisconf}" | ||||||
|   exec { 'redis': |   exec { 'redis': | ||||||
|     unless  => "/bin/grep -Fxqe '${line}' '${file}'", |     unless  => "/bin/grep -Fxqe '${line}' '${file}'", | ||||||
|     path    => '/bin', |     path    => '/bin', | ||||||
|     command => "bash -c \"(/bin/echo; /bin/echo '# Include Zulip-specific configuration'; /bin/echo '${line}') >> '${file}'\"", |     command => "bash -c \"(/bin/echo; /bin/echo '# Include Zulip-specific configuration'; /bin/echo '${line}') >> '${file}'\"", | ||||||
|     require => [Package[$redis], |     require => [Package[$redis], | ||||||
|                 File[$zulip_redisconf]], |                 File[$zulip_redisconf], | ||||||
|  |                 Exec['rediscleanup-zuli-redis']], | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   # Fix the typo in the path to $zulip_redisconf introduced in | ||||||
|  |   # 071e32985c1207f20043e1cf28f82300d9f23f31 without triggering a | ||||||
|  |   # redis restart. | ||||||
|  |   $legacy_wrong_filename = "${redis_dir}/zuli-redis.conf" | ||||||
|  |   exec { 'rediscleanup-zuli-redis': | ||||||
|  |     onlyif   => "test -e ${legacy_wrong_filename}", | ||||||
|  |     command  => " | ||||||
|  |       mv ${legacy_wrong_filename} ${zulip_redisconf} | ||||||
|  |       perl -0777 -pe ' | ||||||
|  |         if (m|^\\Q${line}\\E\$|m) { | ||||||
|  |           s|^\\n?(:?# Include Zulip-specific configuration\\n)?include \\Q${legacy_wrong_filename}\\E\\n||m; | ||||||
|  |         } else { | ||||||
|  |           s|^include \\Q${legacy_wrong_filename}\\E\$|${line}|m; | ||||||
|  |         } | ||||||
|  |       ' -i /etc/redis/redis.conf | ||||||
|  |     ", | ||||||
|  |     provider => shell, | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   $redis_password = zulipsecret('secrets', 'redis_password', '') |   $redis_password = zulipsecret('secrets', 'redis_password', '') | ||||||
|   file { $zulip_redisconf: |   file { $zulip_redisconf: | ||||||
|     ensure  => file, |     ensure  => file, | ||||||
|     require => Package[$redis], |     require => [Package[$redis], Exec['rediscleanup-zuli-redis']], | ||||||
|     owner   => 'redis', |     owner   => 'redis', | ||||||
|     group   => 'redis', |     group   => 'redis', | ||||||
|     mode    => '0640', |     mode    => '0640', | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user