File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7676 tags : " intro_website"
7777 - role : " committeeclash"
7878 tags : " committeeclash"
79+ - role : " keycloak"
80+ tags : " keycloak"
7981 - role : " rottenspringbok"
8082 tags : " rottenspringbok"
8183 - role : " studytrip"
Original file line number Diff line number Diff line change 1+ ---
2+ - name : " create user"
3+ ansible.builtin.user :
4+ name : " keycloak"
5+ home : " {{ keycloak_project_source }}"
6+ shell : " /usr/sbin/nologin"
7+ state : " present"
8+ system : true
9+
10+ - name : " set up keycloak"
11+ become_user : " keycloak"
12+ become : true
13+ block :
14+ - name : " clone repository"
15+ ansible.builtin.git :
16+ repo : " https://github.com/svsticky/improved-adventure.git"
17+ dest : " {{ keycloak_project_source }}"
18+ depth : 1
19+ version : main # "{% if 'production' in group_names %}main{% else %}development{% endif %}" # Pull main when deploying to prod
20+ diff : false
21+
22+ - name : " Copy .env file"
23+ ansible.builtin.template :
24+ src : " .env.j2"
25+ dest : " {{ keycloak_project_source }}/.env"
26+ diff : false
27+
28+ - name : " Docker compose"
29+ ansible.builtin.include_tasks : " ../docker/tasks/compose-up.yml"
30+ vars :
31+ project_source : " {{ keycloak_project_source }}"
32+ remove_images : all
33+
34+ - name : " Copy nginx configuration"
35+ ansible.builtin.template :
36+ src : " keycloak.conf.j2"
37+ dest : " /etc/nginx/sites-available/keycloak.{{ canonical_hostname }}.conf"
38+ notify : " reload nginx"
39+
40+ - name : " Enable nginx configuration for keycloak"
41+ ansible.builtin.file :
42+ src : " /etc/nginx/sites-available/keycloak.{{ canonical_hostname }}.conf"
43+ path : " /etc/nginx/sites-enabled/keycloak.{{ canonical_hostname }}.conf"
44+ state : link
45+ notify : " reload nginx"
Original file line number Diff line number Diff line change 1+ # TODO: add input here
2+ DB_PASSWORD=foobar
Original file line number Diff line number Diff line change 1+ server {
2+ listen 443 ssl http2;
3+ listen [::]:443 ssl http2;
4+ server_name keycloak.{{ canonical_hostname }};
5+
6+ ssl_certificate /etc/letsencrypt/live/keycloak.{{ canonical_hostname }}/fullchain.pem;
7+ ssl_certificate_key /etc/letsencrypt/live/keycloak.{{ canonical_hostname }}/privkey.pem;
8+ ssl_trusted_certificate /etc/letsencrypt/live/keycloak.{{ canonical_hostname }}/chain.pem;
9+
10+ location / {
11+ proxy_pass http://localhost:{{ keycloak_port }}/;
12+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
13+ proxy_set_header X-Forwarded-Proto https;
14+ proxy_set_header Host $http_host;
15+ proxy_set_header Upgrade $http_upgrade;
16+ proxy_set_header Connection "upgrade";
17+ }
18+ }
19+
Original file line number Diff line number Diff line change 1+ ---
2+ keycloak_port : 6666
3+ keycloak_project_source : /var/www/keycloak
You can’t perform that action at this time.
0 commit comments