Move envvars to /etc/defaults
This commit is contained in:
		
							parent
							
								
									e14220a01b
								
							
						
					
					
						commit
						210d3ebf4d
					
				@ -8,6 +8,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
- include_tasks: tasks/install.yml
 | 
					- include_tasks: tasks/install.yml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## FIXME not idempotent (keyclock removes the file when it restarts)
 | 
				
			||||||
- name: create Keycloak admin user
 | 
					- name: create Keycloak admin user
 | 
				
			||||||
  command:
 | 
					  command:
 | 
				
			||||||
  args:
 | 
					  args:
 | 
				
			||||||
 | 
				
			|||||||
@ -38,12 +38,30 @@
 | 
				
			|||||||
    daemon_reload: yes
 | 
					    daemon_reload: yes
 | 
				
			||||||
  when: systemdunit.changed
 | 
					  when: systemdunit.changed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: start keycloak
 | 
					- block:
 | 
				
			||||||
 | 
					    - name: start keycloak
 | 
				
			||||||
      systemd:
 | 
					      systemd:
 | 
				
			||||||
        name: keycloak
 | 
					        name: keycloak
 | 
				
			||||||
        enabled: yes
 | 
					        enabled: yes
 | 
				
			||||||
        state: started
 | 
					        state: started
 | 
				
			||||||
      become: yes
 | 
					      become: yes
 | 
				
			||||||
 | 
					  rescue:
 | 
				
			||||||
 | 
					    - command: "systemctl status keycloak"
 | 
				
			||||||
 | 
					      changed_when: False
 | 
				
			||||||
 | 
					      ignore_errors: True
 | 
				
			||||||
 | 
					    - command: "journalctl -xe -ukeycloak"
 | 
				
			||||||
 | 
					      changed_when: False
 | 
				
			||||||
 | 
					      ignore_errors: True
 | 
				
			||||||
 | 
					    - command: "tail -n 100 /opt/keycloak/keycloak.log"
 | 
				
			||||||
 | 
					      changed_when: False
 | 
				
			||||||
 | 
					      ignore_errors: True
 | 
				
			||||||
 | 
					    - debug:
 | 
				
			||||||
 | 
					        msg: "Virt type: {{ ansible_facts.virtualization_type }}"
 | 
				
			||||||
 | 
					      changed_when: False
 | 
				
			||||||
 | 
					      ignore_errors: True
 | 
				
			||||||
 | 
					    - command: "cat /opt/keycloak/keycloak-service.sh"
 | 
				
			||||||
 | 
					      changed_when: False
 | 
				
			||||||
 | 
					      ignore_errors: True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- command: "systemctl status keycloak"
 | 
					- command: "systemctl status keycloak"
 | 
				
			||||||
  register: keycloak_service_status
 | 
					  register: keycloak_service_status
 | 
				
			||||||
 | 
				
			|||||||
@ -5,3 +5,5 @@ KEYCLOAK_HTTP_PORT={{ keycloak_http_port }}
 | 
				
			|||||||
KEYCLOAK_HTTPS_PORT={{ keycloak_https_port }}
 | 
					KEYCLOAK_HTTPS_PORT={{ keycloak_https_port }}
 | 
				
			||||||
KEYCLOAK_MANAGEMENT_HTTP_PORT={{ keycloak_management_http_port }}
 | 
					KEYCLOAK_MANAGEMENT_HTTP_PORT={{ keycloak_management_http_port }}
 | 
				
			||||||
KEYCLOAK_MANAGEMENT_HTTPS_PORT={{ keycloak_management_https_port }}
 | 
					KEYCLOAK_MANAGEMENT_HTTPS_PORT={{ keycloak_management_https_port }}
 | 
				
			||||||
 | 
					JBOSS_PIDFILE='{{ keycloak_service_pidfile }}'
 | 
				
			||||||
 | 
					LAUNCH_JBOSS_IN_BACKGROUND=1
 | 
				
			||||||
@ -11,7 +11,7 @@ Group={{ keycloak_service_group }}
 | 
				
			|||||||
PIDFile={{ keycloak_service_pidfile }}
 | 
					PIDFile={{ keycloak_service_pidfile }}
 | 
				
			||||||
ExecStart={{ keycloak_dest }}/keycloak-service.sh start
 | 
					ExecStart={{ keycloak_dest }}/keycloak-service.sh start
 | 
				
			||||||
ExecStop={{ keycloak_dest }}/keycloak-service.sh stop
 | 
					ExecStop={{ keycloak_dest }}/keycloak-service.sh stop
 | 
				
			||||||
TimeoutStartSec=30
 | 
					TimeoutStartSec=45
 | 
				
			||||||
TimeoutStopSec=30
 | 
					TimeoutStopSec=30
 | 
				
			||||||
LimitNOFILE=102642
 | 
					LimitNOFILE=102642
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user