authcheck: Initial version of role

This commit is contained in:
Timo Makinen 2023-01-29 17:15:34 +00:00
parent ed7535dd1a
commit 43c234d8cf
4 changed files with 84 additions and 0 deletions

View file

@ -0,0 +1,45 @@
---
- name: Create group
ansible.builtin.group:
name: authcheck
- name: Create user
ansible.builtin.user:
name: authcheck
comment: Podman Auth
group: authcheck
shell: /sbin/nologin
- name: Get container source
ansible.builtin.git:
dest: /usr/local/src/docker-authcheck
repo: https://github.com/foo-sh/docker-authcheck.git
update: false
version: main
notify: Rebuild authcheck-container
- name: Create service file
ansible.builtin.template:
dest: /etc/systemd/system/authcheck-container.service
src: authcheck-container.service.j2
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
- name: Enable service
ansible.builtin.service:
name: authcheck-container
state: started
enabled: true
- name: Copy nginx config
ansible.builtin.copy:
dest: "/etc/nginx/conf.d/{{ inventory_hostname }}/authcheck-container.conf"
content: |
location /authcheck {
proxy_pass http://127.0.0.1:8003;
}
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
notify: Restart nginx