mirror of
				https://gitea.0xace.cc/ansible-galaxy/redis.git
				synced 2025-11-04 13:47:24 +00:00 
			
		
		
		
	add redis_force_configure option and use template instead blockinfile for redis-auth.conf
This commit is contained in:
		@@ -6,6 +6,7 @@ redis_requirepass: P@ssw0rd
 | 
			
		||||
redis_masterauth: P@ssw0rd
 | 
			
		||||
redis_masteruser: masteruser
 | 
			
		||||
redis_mastername: mymaster
 | 
			
		||||
redis_force_configure: false
 | 
			
		||||
 | 
			
		||||
redis_debian_apt_key:
 | 
			
		||||
  - name: redis.io.gpg
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@
 | 
			
		||||
    notify:
 | 
			
		||||
      - Restart redis
 | 
			
		||||
 | 
			
		||||
  when: service_redis_status.rc != 0 
 | 
			
		||||
  when: service_redis_status.rc != 0 or redis_force_configure
 | 
			
		||||
 | 
			
		||||
- name: Ensure redis auth config exists
 | 
			
		||||
  copy:
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
    mode: 0640
 | 
			
		||||
 | 
			
		||||
- name: Template redis auth config
 | 
			
		||||
  blockinfile:
 | 
			
		||||
    block: "{{ lookup('template', '{{ ansible_os_family }}/etc/redis/redis-auth.conf.j2') }}"
 | 
			
		||||
    path: "/etc/redis/redis-auth.conf"
 | 
			
		||||
  template:
 | 
			
		||||
    src: "{{ ansible_os_family }}/etc/redis/redis-auth.conf.j2"
 | 
			
		||||
    dest: "/etc/redis/redis-auth.conf"
 | 
			
		||||
  notify:
 | 
			
		||||
    - Restart redis
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user