Update to 2021-12-01 19:13

This commit is contained in:
Daniel Berteaud
2021-12-01 19:13:34 +01:00
commit 4c4556c660
2153 changed files with 60999 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
---
- name: Install dependencies
yum:
name:
- perl-IO
- perl-Getopt-Long
tags: cs
- name: Install main script
copy: src=g2cs.pl dest=/usr/local/bin/g2cs mode=755
notify: restart g2cs
tags: cs
- name: Deploy systemd unit
template: src=g2cs.service.j2 dest=/etc/systemd/system/g2cs.service
notify: restart g2cs
register: g2cs_unit
tags: cs
- name: Reload systemd
systemd: daemon_reload=True
when: g2cs_unit.changed
tags: cs
- name: Deploy tmpfiles.d config
copy:
content: |
d /run/g2cs 0755 g2cs g2cs - -
d /run/g2cs/logs 0700 g2cs g2cs - -
dest: /etc/tmpfiles.d/g2cs.conf
register: g2cs_tmpfiles
tags: cs
- name: Create tmpfiles dir
command: systemd-tmpfiles --create
when: g2cs_tmpfiles.changed
tags: cs

View File

@@ -0,0 +1,8 @@
---
- name: Handle g2cs port in the firewall
iptables_raw:
name: g2cs_port
state: "{{ (g2cs_src_ip | length > 0) | ternary('present','absent') }}"
rules: "-A INPUT -p udp --dport {{ g2cs_port }} -s {{ g2cs_src_ip | join(',') }} -j ACCEPT"
tags: firewall,cs

View File

@@ -0,0 +1,7 @@
---
- include: user.yml
- include: install.yml
- include: iptables.yml
when: iptables_manage | default(True)
- include: service.yml

View File

@@ -0,0 +1,5 @@
---
- name: Start and enable the service
service: name=g2cs state=started enabled=True
tags: cs

View File

@@ -0,0 +1,5 @@
---
- name: Create g2cs user account
user: name=g2cs system=True shell=/sbin/nologin
tags: cs