Files
a13labs.infra/ansible/roles/nginx_proxy/tasks/oauth2_proxy.yml
T
alexandre.pires 272ed647cf Refactor and enhance Ansible configurations for dev-02 and nginx proxy setup
- Updated host_vars for dev-02 to include login history settings and modified code server authentication.
- Adjusted opencode server configurations and reduced resource allocation.
- Introduced a new playbook for configuring nginx reverse proxy with TLS and OAuth2.
- Enhanced linux_dev_station role defaults and tasks, including package updates and service configurations.
- Removed unnecessary credential assertions in linux_dev_station tasks.
- Created nginx_proxy role with tasks for certbot, nginx installation, and oauth2-proxy setup.
- Added templates for nginx and oauth2-proxy configurations.
- Updated terraform configuration to reflect new DNS records for ide and agent services.
- Documented changes and configurations in linux_dev_station.md for clarity and future reference.
2026-07-11 19:29:50 -04:00

69 lines
1.7 KiB
YAML

---
- name: Download oauth2-proxy
become: true
ansible.builtin.get_url:
url: "https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v{{ nginx_proxy_oauth2_proxy_version }}/oauth2-proxy-v{{ nginx_proxy_oauth2_proxy_version }}.linux-amd64.tar.gz"
dest: /tmp/oauth2-proxy.tar.gz
mode: "0644"
- name: Extract oauth2-proxy binary
become: true
ansible.builtin.unarchive:
src: /tmp/oauth2-proxy.tar.gz
dest: /tmp/
remote_src: true
- name: Install oauth2-proxy binary
become: true
ansible.builtin.copy:
src: >-
/tmp/oauth2-proxy-v{{ nginx_proxy_oauth2_proxy_version }}.linux-amd64/oauth2-proxy
dest: /usr/local/bin/oauth2-proxy
mode: "0755"
owner: root
group: root
- name: Create oauth2-proxy config directory
become: true
ansible.builtin.file:
path: /etc/oauth2-proxy
state: directory
mode: "0755"
owner: root
group: root
- name: Deploy oauth2-proxy configuration
become: true
ansible.builtin.template:
src: oauth2-proxy.cfg.j2
dest: /etc/oauth2-proxy/oauth2-proxy.cfg
mode: "0640"
owner: root
group: nginx
- name: Create oauth2-proxy log file
become: true
ansible.builtin.file:
path: "{{ nginx_proxy_oauth2_proxy_log_file }}"
state: touch
mode: "0644"
owner: nginx
group: nginx
- name: Deploy oauth2-proxy systemd service
become: true
ansible.builtin.template:
src: oauth2-proxy.service.j2
dest: /etc/systemd/system/oauth2-proxy.service
mode: "0644"
owner: root
group: root
- name: Enable and start oauth2-proxy
become: true
ansible.builtin.systemd:
name: oauth2-proxy
state: started
enabled: true
daemon_reload: true