homelab/roles/oauth2proxy/tasks/main.yml

34 lines
896 B
YAML

- name: ensure directories exist
file:
path: "{{ item }}"
state: directory
mode: '0755'
loop:
- "{{ data_folder }}/oauth2-proxy"
- name: copy oauth2-proxy config
template:
src: oauth2-proxy.cfg
dest: "{{ data_folder }}/oauth2-proxy/oauth2-proxy.cfg"
mode: '0755'
notify: reload nginx
- name: run container
docker_container:
name: 'oauth2-proxy'
image: quay.io/oauth2-proxy/oauth2-proxy
networks:
- name: bridge
- name: nginx-internal
command: '/bin/oauth2-proxy --config=/etc/oauth2-proxy.cfg'
volumes:
- "{{ data_folder }}/oauth2-proxy/oauth2-proxy.cfg:/etc/oauth2-proxy.cfg"
ports:
- "4180:4180"
state: started
restart: yes
- name: copy oauth2-proxy nginx config
template:
src: oauth2-proxy.conf.j2
dest: "{{ nginx_confd_folder }}/oauth2-proxy.conf"
mode: '0755'
notify: reload nginx