mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	set DB_PASSWORD in env file
This commit is contained in:
		@@ -16,7 +16,7 @@
 | 
			
		||||
 | 
			
		||||
- name: Use default env vars (should be updated!)
 | 
			
		||||
  template:
 | 
			
		||||
    src: "env_example"
 | 
			
		||||
    src: "env.j2"
 | 
			
		||||
    dest: "/var/www/note_kfet/.env"
 | 
			
		||||
    mode: 0644
 | 
			
		||||
    force: false
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								ansible/roles/2-nk20/templates/env.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								ansible/roles/2-nk20/templates/env.j2
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
DJANGO_APP_STAGE=prod
 | 
			
		||||
# Only used in dev mode, change to "postgresql" if you want to use PostgreSQL in dev
 | 
			
		||||
DJANGO_DEV_STORE_METHOD=sqlite
 | 
			
		||||
DJANGO_DB_HOST=localhost
 | 
			
		||||
DJANGO_DB_NAME=note_db
 | 
			
		||||
DJANGO_DB_USER=note
 | 
			
		||||
DJANGO_DB_PASSWORD={{ DB_PASSWORD }}
 | 
			
		||||
DJANGO_DB_PORT=
 | 
			
		||||
DJANGO_SECRET_KEY=CHANGE_ME
 | 
			
		||||
DJANGO_SETTINGS_MODULE=note_kfet.settings
 | 
			
		||||
CONTACT_EMAIL=tresorerie.bde@localhost
 | 
			
		||||
NOTE_URL=localhost
 | 
			
		||||
DOMAIN=localhost
 | 
			
		||||
 | 
			
		||||
# Config for mails. Only used in production
 | 
			
		||||
NOTE_MAIL=notekfet@localhost
 | 
			
		||||
EMAIL_HOST=smtp.localhost
 | 
			
		||||
EMAIL_PORT=25
 | 
			
		||||
EMAIL_USER=notekfet@localhost
 | 
			
		||||
EMAIL_PASSWORD=CHANGE_ME
 | 
			
		||||
 | 
			
		||||
# Wiki configuration
 | 
			
		||||
WIKI_USER=NoteKfet2020
 | 
			
		||||
WIKI_PASSWORD=
 | 
			
		||||
@@ -11,14 +11,14 @@
 | 
			
		||||
  until: pkg_result is succeeded
 | 
			
		||||
 | 
			
		||||
- name: Create role note
 | 
			
		||||
  when: "DB_PASSWORD|bool"    # If the password is not defined, skip the installation
 | 
			
		||||
  when: DB_PASSWORD|length > 0 # If the password is not defined, skip the installation
 | 
			
		||||
  postgresql_user:
 | 
			
		||||
    name: note
 | 
			
		||||
    password: "{{ DB_PASSWORD }}"
 | 
			
		||||
  become_user: postgres
 | 
			
		||||
 | 
			
		||||
- name: Create NK20 database
 | 
			
		||||
  when: "DB_PASSWORD|bool"
 | 
			
		||||
  when: DB_PASSWORD|length >0
 | 
			
		||||
  postgresql_db:
 | 
			
		||||
    name: note_db
 | 
			
		||||
    owner: note
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user