mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-10-31 15:50:03 +01:00 
			
		
		
		
	🚀 Adding Ansible configuration (not tested)
This commit is contained in:
		
							
								
								
									
										14
									
								
								ansible/ansible.cfg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								ansible/ansible.cfg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| [defaults] | ||||
| inventory = ./hosts | ||||
| timeout = 42 | ||||
|  | ||||
| [privilege_escalation] | ||||
| become = True | ||||
| become_ask_pass = True | ||||
|  | ||||
| [ssh_connection] | ||||
| pipelining = True | ||||
| retries = 3 | ||||
|  | ||||
| [diff] | ||||
| always = yes | ||||
							
								
								
									
										9
									
								
								ansible/base.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								ansible/base.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| #!/usr/bin/env ansible-python | ||||
| --- | ||||
|  | ||||
| - hosts: beta-nk20 | ||||
|   roles: | ||||
|     - apt-basic | ||||
|     - nk20 | ||||
|     - python-venv | ||||
|     - nginx | ||||
							
								
								
									
										5
									
								
								ansible/hosts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								ansible/hosts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| [server] | ||||
| bde-nk20-beta.adh.crans.org | ||||
|  | ||||
| [all:vars] | ||||
| ansible_python_interpreter=/usr/bin/python3 | ||||
							
								
								
									
										20
									
								
								ansible/roles/apt-basic/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								ansible/roles/apt-basic/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| --- | ||||
| - name: Install basic APT packages | ||||
|   apt: | ||||
|     update_cache: true | ||||
|     name: | ||||
|       - nginx | ||||
|       - python3 | ||||
|       - python3-pip | ||||
|       - python3-dev | ||||
|       - uwsgi | ||||
|       - uwsgi-plugin-python3 | ||||
|       - python3-venv | ||||
|       - git | ||||
|       - acl | ||||
|       - texlive-latex-extra | ||||
|       - texlive-fonts-extra | ||||
|       - texlive-lang-french | ||||
|     register: pkg_result | ||||
|     retries: 3 | ||||
|     until: pkg_result is succedded | ||||
							
								
								
									
										19
									
								
								ansible/roles/nginx/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								ansible/roles/nginx/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| --- | ||||
| - name: Update Nginx conf | ||||
|   replace: | ||||
|     path: /var/www/note_kfet/nginx_note.conf.example | ||||
|     dest: /var/www/note_kfet/nginx_note.conf | ||||
|     regexp: 'note.example.org' | ||||
|     replace: 'bde-nk20-beta.adh.crans.org' | ||||
|  | ||||
| - name: Copy conf to Nginx | ||||
|   file: | ||||
|     path: /var/www/note_kfet/nginx_note.conf | ||||
|     dest: /etc/nginx/sites-enabled/nginx_note.conf | ||||
|     state: link | ||||
|  | ||||
| - name: Copy conf to UWSGI | ||||
|   file: | ||||
|     path: /var/www/note_kfet/uwsgi_note.ini | ||||
|     dest: /etc/uwsgi/apps-enabled/uwsgi_note.ini | ||||
|     state: link | ||||
							
								
								
									
										12
									
								
								ansible/roles/nk20/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								ansible/roles/nk20/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| --- | ||||
| - name: Create note_kfet dir with good permissions | ||||
|   file: | ||||
|     path: /var/www | ||||
|     owner: www-data | ||||
|     group: foo | ||||
|     mode: u=rw,g=rws,o=r | ||||
|  | ||||
| - name: Clone Note Kfet | ||||
|   git: | ||||
|     repo: https://gitlab.crans.org/bde/nk20.git | ||||
|     dest: /var/www/note_kfet | ||||
							
								
								
									
										10
									
								
								ansible/roles/python-venv/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								ansible/roles/python-venv/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| --- | ||||
| - name: Install PIP basic dependencies | ||||
|   pip: | ||||
|     requirements: /var/www/note_kfet/requirements/base.txt | ||||
|     virtualenv: /var/www/note_kfet/env | ||||
|  | ||||
| - name: Install PIP production dependencies | ||||
|   pip: | ||||
|     requirements: /var/www/note_kfet/requirements/production.txt | ||||
|     virtualenv: /var/www/note_kfet/env | ||||
		Reference in New Issue
	
	Block a user