[linx] Add linx server, role and playbook
							parent
							
								
									555e9c375f
								
							
						
					
					
						commit
						1d5310127e
					
				| 
						 | 
					@ -38,6 +38,7 @@ nginx:
 | 
				
			||||||
    - {from: roundcube.crans.org, to: 172.16.10.107}
 | 
					    - {from: roundcube.crans.org, to: 172.16.10.107}
 | 
				
			||||||
    - {from: hedgedoc.crans.org, to: "172.16.10.128:3000"}
 | 
					    - {from: hedgedoc.crans.org, to: "172.16.10.128:3000"}
 | 
				
			||||||
    - {from: owncloud.crans.org, to: 172.16.10.136}
 | 
					    - {from: owncloud.crans.org, to: 172.16.10.136}
 | 
				
			||||||
 | 
					    - {from: linx.crans.org, to: "172.16.10.119:8080"}
 | 
				
			||||||
    # - {from: belenios.crans.org, to: 172.16.10.111}
 | 
					    # - {from: belenios.crans.org, to: 172.16.10.111}
 | 
				
			||||||
    # - {from: mailman.crans.org, to: 10.231.136.180}
 | 
					    # - {from: mailman.crans.org, to: 10.231.136.180}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								hosts
								
								
								
								
							
							
						
						
									
										1
									
								
								hosts
								
								
								
								
							| 
						 | 
					@ -148,6 +148,7 @@ jitsi.adm.crans.org
 | 
				
			||||||
kenobi.adm.crans.org
 | 
					kenobi.adm.crans.org
 | 
				
			||||||
kiwi.adm.crans.org
 | 
					kiwi.adm.crans.org
 | 
				
			||||||
kiwijuice.adm.crans.org
 | 
					kiwijuice.adm.crans.org
 | 
				
			||||||
 | 
					linx.adm.crans.org
 | 
				
			||||||
monitoring.adm.crans.org
 | 
					monitoring.adm.crans.org
 | 
				
			||||||
owl.adm.crans.org
 | 
					owl.adm.crans.org
 | 
				
			||||||
owncloud.adm.crans.org
 | 
					owncloud.adm.crans.org
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,9 @@
 | 
				
			||||||
 | 
					#!/usr/bin/env ansible-playbook
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					- hosts: linx.adm.crans.org
 | 
				
			||||||
 | 
					  vars:
 | 
				
			||||||
 | 
					    linx:
 | 
				
			||||||
 | 
					      ip: "{{ query('ldap', 'ip', 'linx', 'adm') }}"
 | 
				
			||||||
 | 
					      siteurl: "https://linx.crans.org/"
 | 
				
			||||||
 | 
					  roles:
 | 
				
			||||||
 | 
					    - linx
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,5 @@
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					- name: Restart linx-server
 | 
				
			||||||
 | 
					  service:
 | 
				
			||||||
 | 
					    name: linx-server
 | 
				
			||||||
 | 
					    state: restarted
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,37 @@
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					#- name: Install linx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Create linx user
 | 
				
			||||||
 | 
					  user:
 | 
				
			||||||
 | 
					    create_home: yes
 | 
				
			||||||
 | 
					    home: /var/lib/linx
 | 
				
			||||||
 | 
					    system: yes
 | 
				
			||||||
 | 
					    state: present
 | 
				
			||||||
 | 
					    password: "!"
 | 
				
			||||||
 | 
					    update_password: always
 | 
				
			||||||
 | 
					    name: linx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Create linx config dir
 | 
				
			||||||
 | 
					  file:
 | 
				
			||||||
 | 
					    path: /etc/linx
 | 
				
			||||||
 | 
					    state: directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Deploy configuration file
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: "linx/server.conf.j2"
 | 
				
			||||||
 | 
					    dest: "/etc/linx/server.conf"
 | 
				
			||||||
 | 
					    mode: 0644
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Install linx systemd unit
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    src: "systemd/system/linx-server.service.j2"
 | 
				
			||||||
 | 
					    dest: "/etc/systemd/system/linx-server.service"
 | 
				
			||||||
 | 
					    mode: 0644
 | 
				
			||||||
 | 
					  notify: Restart linx-server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Load and activate linx systemd unit
 | 
				
			||||||
 | 
					  systemd:
 | 
				
			||||||
 | 
					    name: linx-server.service
 | 
				
			||||||
 | 
					    daemon_reload: true
 | 
				
			||||||
 | 
					    enabled: true
 | 
				
			||||||
 | 
					    state: started
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,9 @@
 | 
				
			||||||
 | 
					{{ ansible_header | comment }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bind = {{ linx.ip }}:8080
 | 
				
			||||||
 | 
					sitename = CRANS Linx
 | 
				
			||||||
 | 
					siteurl = {{ linx.siteurl }}
 | 
				
			||||||
 | 
					maxsize = 10000000
 | 
				
			||||||
 | 
					maxexpiry = 604800
 | 
				
			||||||
 | 
					filespath = /var/lib/linx/files/
 | 
				
			||||||
 | 
					metapath = /var/lib/linx/meta/
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,16 @@
 | 
				
			||||||
 | 
					{{ ansible_header | comment }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Unit]
 | 
				
			||||||
 | 
					Description=Linx
 | 
				
			||||||
 | 
					After=network.target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Service]
 | 
				
			||||||
 | 
					Type=simple
 | 
				
			||||||
 | 
					User=linx
 | 
				
			||||||
 | 
					Group=linx
 | 
				
			||||||
 | 
					WorkingDirectory=/var/lib/linx/
 | 
				
			||||||
 | 
					ExecStart=/usr/local/sbin/linx-server -config /etc/linx/server.conf
 | 
				
			||||||
 | 
					Restart=always
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Install]
 | 
				
			||||||
 | 
					WantedBy=multi-user.target
 | 
				
			||||||
		Loading…
	
		Reference in New Issue