ipsilon: Initial version of role
This commit is contained in:
parent
0be436e8b0
commit
fb3608fa6e
5 changed files with 128 additions and 0 deletions
74
roles/ipsilon/tasks/main.yml
Normal file
74
roles/ipsilon/tasks/main.yml
Normal file
|
@ -0,0 +1,74 @@
|
|||
---
|
||||
- name: Create group
|
||||
ansible.builtin.group:
|
||||
name: ipsilon
|
||||
|
||||
- name: Create user
|
||||
ansible.builtin.user:
|
||||
name: ipsilon
|
||||
comment: Podman Ipsilon
|
||||
group: ipsilon
|
||||
shell: /sbin/nologin
|
||||
|
||||
- name: Enable user lingering
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- loginctl
|
||||
- enable-linger
|
||||
- ipsilon
|
||||
creates: /var/lib/systemd/linger/ipsilon
|
||||
|
||||
- name: Copy host key
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ tls_private }}/ipsilon.key"
|
||||
src: "{{ tls_private }}/{{ inventory_hostname }}.key"
|
||||
mode: "0640"
|
||||
owner: root
|
||||
group: ipsilon
|
||||
remote_src: true
|
||||
|
||||
- name: Get container source
|
||||
ansible.builtin.git:
|
||||
dest: /usr/local/src/docker-ipsilon
|
||||
repo: https://github.com/foo-sh/docker-ipsilon.git
|
||||
update: true
|
||||
version: master
|
||||
notify: Rebuild ipsilon-container
|
||||
|
||||
- name: Create service file
|
||||
ansible.builtin.template:
|
||||
dest: /etc/systemd/system/ipsilon-container.service
|
||||
src: ipsilon-container.service.j2
|
||||
mode: "0644"
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: Restart ipsilon-container
|
||||
|
||||
- name: Create service config
|
||||
ansible.builtin.template:
|
||||
dest: /etc/sysconfig/ipsilon-container
|
||||
src: ipsilon-container.sysconfig.j2
|
||||
mode: "0600"
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: Restart ipsilon-container
|
||||
|
||||
- name: Enable service
|
||||
ansible.builtin.service:
|
||||
name: ipsilon-container
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Copy nginx config
|
||||
ansible.builtin.copy:
|
||||
dest: "/etc/nginx/conf.d/{{ inventory_hostname }}/ipsilon-container.conf"
|
||||
content: |
|
||||
location /ipsilon {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Host idp.foo.sh;
|
||||
proxy_pass http://127.0.0.1:8011/;
|
||||
}
|
||||
mode: "0644"
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
notify: Restart nginx
|
Loading…
Add table
Add a link
Reference in a new issue