---
# 2 Отредактировать файл server.conf
- name: server_conf 
  ansible.builtin.lineinfile:
    path: "{{ openvpn_dir }}/server.conf"
    line: '{{ item }}'
    create: yes
  loop:
    - port 1195 
    - proto udp 
    - dev tun 
    - ca ca.crt  
    - cert server.crt 
    - key server.key 
    - tls-auth ta.key 0 
    - key-direction 0
    - cipher AES-256-GCM
    - auth SHA256
    - dh dh.pem
    - user nobody
    - group nogroup
    - server 10.88.99.0 255.255.255.0
    - keepalive 10 120
    - tls-auth ta.key 0 # This file is secret
    - persist-key
    - persist-tun
    - status /var/log/openvpn/openvpn-status.log
    - log    /var/log/openvpn/openvpn.log 
    - ifconfig-pool-persist /var/log/openvpn/ipp.txt
    - verb 3
    - explicit-exit-notify 1
    - push "route 192.168.1.0 255.255.255.0"
    - client-config-dir "{{ openvpn_dir }}/ccd"




