| 
															
																@@ -1,4 +1,5 @@ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 - name: Ensure nginx configuration is up to date 
															 | 
															
															 | 
															
																 - name: Ensure nginx configuration is up to date 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  become: yes 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   template: 
															 | 
															
															 | 
															
																   template: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     src: "{{ item.src }}" 
															 | 
															
															 | 
															
																     src: "{{ item.src }}" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     dest: "/etc/nginx/sites-available/{{ item.dest }}" 
															 | 
															
															 | 
															
																     dest: "/etc/nginx/sites-available/{{ item.dest }}" 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -9,11 +10,13 @@ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																       dest: gogs_unsecure.conf 
															 | 
															
															 | 
															
																       dest: gogs_unsecure.conf 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 - name: Ensure unsecure nginx configuration is up to date 
															 | 
															
															 | 
															
																 - name: Ensure unsecure nginx configuration is up to date 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  become: yes 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   template: 
															 | 
															
															 | 
															
																   template: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     src: gogs_unsecure.conf.j2 
															 | 
															
															 | 
															
																     src: gogs_unsecure.conf.j2 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     dest: /etc/nginx/sites-available/gogs_unsecure.conf 
															 | 
															
															 | 
															
																     dest: /etc/nginx/sites-available/gogs_unsecure.conf 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 - name: Ensure unsecure gogs configuration for nginx is enabled 
															 | 
															
															 | 
															
																 - name: Ensure unsecure gogs configuration for nginx is enabled 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  become: yes 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   file:  
															 | 
															
															 | 
															
																   file:  
															 | 
														
													
												
													
														
															| 
															 | 
															
																     state: link 
															 | 
															
															 | 
															
																     state: link 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     dest: /etc/nginx/sites-enabled/gogs_unsecure.conf 
															 | 
															
															 | 
															
																     dest: /etc/nginx/sites-enabled/gogs_unsecure.conf 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -21,20 +24,25 @@ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   notify: Reload nginx 
															 | 
															
															 | 
															
																   notify: Reload nginx 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 - name: Ensure nginx is running 
															 | 
															
															 | 
															
																 - name: Ensure nginx is running 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  become: yes 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   service: 
															 | 
															
															 | 
															
																   service: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     name: nginx 
															 | 
															
															 | 
															
																     name: nginx 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     state: started 
															 | 
															
															 | 
															
																     state: started 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 - stat: 
															 | 
															
															 | 
															
																 - stat: 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     path: "/var/lib/acme/live/{{ gogs_domain }}/privkey;" 
															 | 
															
															 | 
															
																     path: "/var/lib/acme/live/{{ gogs_domain }}/privkey;" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  become: yes 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   register: gogs_key_file_stat 
															 | 
															
															 | 
															
																   register: gogs_key_file_stat 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 - name: Let acmetool generate a key and a certificate 
															 | 
															
															 | 
															
																 - name: Let acmetool generate a key and a certificate 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  become: yes 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   when: not gogs_key_file_stat.stat.exists 
															 | 
															
															 | 
															
																   when: not gogs_key_file_stat.stat.exists 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   shell: /usr/bin/acmetool want --batch {{ gogs_domain }} 
															 | 
															
															 | 
															
																   shell: /usr/bin/acmetool want --batch {{ gogs_domain }} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  notify: Restart nginx 
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																  
															 | 
															
															 | 
															
																  
															 | 
														
													
												
													
														
															| 
															 | 
															
																 - name: Ensure gogs configuration for nginx is enabled 
															 | 
															
															 | 
															
																 - name: Ensure gogs configuration for nginx is enabled 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+  become: yes 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   file:  
															 | 
															
															 | 
															
																   file:  
															 | 
														
													
												
													
														
															| 
															 | 
															
																     state: link 
															 | 
															
															 | 
															
																     state: link 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     dest: /etc/nginx/sites-enabled/gogs.conf 
															 | 
															
															 | 
															
																     dest: /etc/nginx/sites-enabled/gogs.conf 
															 |