Use systemd service for git repository.
This commit is contained in:
		
							parent
							
								
									d7a1a146dd
								
							
						
					
					
						commit
						e51f6c5e2d
					
				
					 3 changed files with 25 additions and 23 deletions
				
			
		|  | @ -1,7 +1,7 @@ | ||||||
| - name: reload xinetd | - name: start git-repo | ||||||
|   systemd: |   systemd: | ||||||
|     daemon_reload: yes |     daemon_reload: yes | ||||||
|     name: xinetd |     name: git-repo | ||||||
|     state: reloaded |     state: started | ||||||
|     enabled: yes |     enabled: yes | ||||||
|   listen: reload xinetd |   listen: start git-repo | ||||||
|  |  | ||||||
|  | @ -70,12 +70,8 @@ | ||||||
|     update: no |     update: no | ||||||
|   become_user: "ansible" |   become_user: "ansible" | ||||||
| 
 | 
 | ||||||
| - name: install xinetd | - name: start git-repo | ||||||
|   apt: |  | ||||||
|     name: xinetd |  | ||||||
| 
 |  | ||||||
| - name: enable git repo |  | ||||||
|   template: |   template: | ||||||
|     src: git-repo.j2 |     src: git-repo.j2 | ||||||
|     dest: "/etc/xinetd.d/git-repo" |     dest: "/etc/systemd/system/git-repo.service" | ||||||
|   notify: "reload xinetd" |   notify: start git-repo | ||||||
|  |  | ||||||
|  | @ -1,12 +1,18 @@ | ||||||
| # Access to git repository. | [Unit] | ||||||
| service git | Description=Start Git Daemon | ||||||
| { | 
 | ||||||
|         disable = no | [Service] | ||||||
|         type            = UNLISTED | ExecStart=/usr/bin/git daemon --reuseaddr --export-all --base-path={{ repo_dir }} | ||||||
|         port            = 9418 | 
 | ||||||
|         socket_type     = stream | Restart=always | ||||||
|         wait            = no | RestartSec=500ms | ||||||
|         user            = nobody | 
 | ||||||
|         server          = /usr/bin/git | StandardOutput=syslog | ||||||
|         server_args     = daemon --inetd --export-all --base-path={{ repo_dir }} | StandardError=syslog | ||||||
| } | SyslogIdentifier=git-daemon | ||||||
|  | 
 | ||||||
|  | User=nobody | ||||||
|  | Group=nogroup | ||||||
|  | 
 | ||||||
|  | [Install] | ||||||
|  | WantedBy=multi-user.target | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Andreas B. Mundt
						Andreas B. Mundt