display error when hook fails
This commit is contained in:
		
							parent
							
								
									f2eaece8cb
								
							
						
					
					
						commit
						3d975b1f17
					
				@ -308,7 +308,11 @@ class Domain(PrivateKey):
 | 
			
		||||
    def run_hooks(self) -> None:
 | 
			
		||||
        for hook in self.hooks:
 | 
			
		||||
            logging.info(f"Running hook: '{hook}'")
 | 
			
		||||
            subprocess.run(hook.split())
 | 
			
		||||
            hook_res = subprocess.run(hook.split(),
 | 
			
		||||
                                      stdout=subprocess.DEVNULL,
 | 
			
		||||
                                      stderr=subprocess.PIPE)
 | 
			
		||||
            if hook_res.returncode != 0:
 | 
			
		||||
                logging.error(f"Unable to run hook: {hook_res.stderr}")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
 | 
			
		||||
@ -84,7 +84,9 @@
 | 
			
		||||
  tags: acme_install
 | 
			
		||||
 | 
			
		||||
- name: Perform ACME challenge for each domain
 | 
			
		||||
  command: acme-renew-cert -v -c {{ acme_config_file | quote }}
 | 
			
		||||
  command: acme-renew-cert -c {{ acme_config_file | quote }}
 | 
			
		||||
  changed_when: "'No domain to renew' not in _acme_challenge.stdout"
 | 
			
		||||
  register: _acme_challenge
 | 
			
		||||
  tags: acme_challenge
 | 
			
		||||
 | 
			
		||||
- name: Setup cron job for ACME certificates renewal of {{ domain_name }}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user