Files
fedora-infra_ansible/roles/openvpn/client/tasks/main.yml
Michal Konecny 2ec055db6f Use first uppercase letter for all handlers
This will unify all the handlers to use first uppercase letter for
ansible-lint to stop complaining.

I went through all `notify:` occurrences and fixed them by running
```
set TEXT "text_to_replace"; set REPLACEMENT "replacement_text"; git grep
-rlz "$TEXT" . | xargs -0 sed -i "s/$TEXT/$REPLACEMENT/g"
```

Then I went through all the changes and removed the ones that wasn't
expected to be changed.

Fixes https://pagure.io/fedora-infrastructure/issue/12391

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2025-02-10 20:31:49 +00:00

68 lines
1.9 KiB
YAML

---
# OpenVpn server
- name: Install needed packages
ansible.builtin.package:
state: present
name:
- openvpn
tags:
- packages
- openvpn
- name: Install main config file
ansible.builtin.template: src=client.conf
dest=/etc/openvpn/client/openvpn.conf
owner=root group=root mode=0644
tags:
- install
- openvpn
# notify:
# - Restart openvpn (Fedora)
- name: Install configuration files (rhel and fedora)
ansible.builtin.copy: src={{ item.file }}
dest={{ item.dest }}
owner=root group=root mode={{ item.mode }}
with_items:
- { file: "{{ private }}/files/vpn/pki/issued/{{ inventory_hostname }}.crt",
dest: "/etc/openvpn/client/client.crt",
mode: '0600' }
- { file: "{{ private }}/files/vpn/pki/private/{{ inventory_hostname }}.key",
dest: "/etc/openvpn/client/client.key",
mode: '0600' }
tags:
- install
- openvpn
# notify:
# - Restart openvpn (Fedora)
- name: Make sure openvpn is running in rhel 8+
service: name=openvpn-client@openvpn state=started enabled=true
tags:
- service
- openvpn
- name: Enable openvpn service for Fedora
service: name=openvpn-client@openvpn state=started enabled=true
when: is_fedora is defined
tags:
- service
- openvpn
- name: Create directories for post-vpn service configs
ansible.builtin.file: path="/etc/systemd/system/{{item}}.service.d" state=directory
with_items: "{{postvpnservices}}"
when: is_fedora is defined or (ansible_distribution_major_version|int >= 8 and ansible_distribution == 'RedHat')
tags:
- service
- openvpn
- name: Deploy postvpn.conf for post-vpn services
ansible.builtin.copy: src=postvpn.conf dest="/etc/systemd/system/{{item}}.service.d/postvpn.conf"
with_items: "{{postvpnservices}}"
when: is_fedora is defined or (ansible_distribution_major_version|int >= 8 and ansible_distribution == 'RedHat')
tags:
- service
- openvpn