Skip to content

Commit

Permalink
Make ansible-lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Carbenium committed Oct 22, 2023
1 parent 1072092 commit 3d44fff
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 45 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: lint
uses: ansible/ansible-lint-action@main
with:
targets: "."
- name: lint
uses: ansible/ansible-lint-action@main
with:
targets: "."
14 changes: 7 additions & 7 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ ocserv_enable_auth: []
ocserv_cert_path: "/etc/ocserv/server.crt"
ocserv_key_path: "/etc/ocserv/server.key"

ocserv_use_ca_cert: False # Set to True if certificate auth is used
ocserv_use_ca_cert: false # Set to True if certificate auth is used
ocserv_ca_path: "/etc/ocserv/ca.crt"

ocserv_max_clients: 10
ocserv_compression: False
ocserv_compression: false

ocserv_use_connect_script: False
ocserv_use_disconnect_script: False
ocserv_use_connect_script: false
ocserv_use_disconnect_script: false

ocserv_default_domain: ""
ocserv_cl_network:
ipv4: ""

ocserv_dns:
tunnel_all: True
tunnel_all: true
servers: []
split_domains: []

ocserv_routes: []

ocserv_tcp_port: 443
ocserv_tcp_is_proxy: False
ocserv_tcp_is_proxy: false
ocserv_udp_port: 443
ocserv_banner: 'Welcome to ocserv.'

Expand All @@ -44,4 +44,4 @@ ocserv_vhosts: []
# config_per_group: ...

# Deploy PAM config which enables SSSD backed 2FA OTP authentication
ocserv_pam_otp: False
ocserv_pam_otp: false
17 changes: 6 additions & 11 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
---
- name: reload-ocserv
become: True
service:
name: ocserv.service
enabled: True
state: restarted

- name: reload systemd
become: True
systemd:
daemon_reload: True
- name: Reload ocserv
become: true
ansible.builtin.service:
name: ocserv.service
enabled: true
state: restarted
5 changes: 2 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
galaxy_info:
author: SOSETH
namespace: soseth
description: See README.md
company: sos.ethz.ch
issue_tracker_url: https://github.com/SOSETH/ocserv/issues
license: GPLv3
min_ansible_version: 2.3.0
min_ansible_version: "2.3.0"
platforms:
- name: Debian
versions:
- buster
34 changes: 18 additions & 16 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
---
- include_tasks: variables.yml
- name: Include variables
ansible.builtin.include_tasks: variables.yml

- name: Install ocserv
become: True
package:
become: true
ansible.builtin.package:
name: ocserv
state: present

- name: Configure ocserv
become: True
template:
become: true
ansible.builtin.template:
src: ocserv.conf.j2
dest: /etc/ocserv/ocserv.conf
owner: root
group: root
mode: 0644
notify: reload-ocserv
mode: "0644"
notify: Reload ocserv

- name: Create script dir
become: True
file:
become: true
ansible.builtin.file:
path: /etc/ocserv/scripts
state: directory
mode: "0755"

- name: Copy scripts
become: True
template:
become: true
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/etc/ocserv/scripts/{{ item }}"
owner: root
group: root
mode: 0750
mode: "0750"
with_items:
- connect.sh
- disconnect.sh
when: ocserv_use_connect_script or ocserv_use_disconnect_script
notify: reload-ocserv
notify: Reload ocserv

- name: Deploy PAM config
become: True
copy:
become: true
ansible.builtin.copy:
src: etc_pam_d_ocserv
dest: /etc/pam.d/ocserv
owner: root
group: root
mode: 0644
mode: "0644"
when: ocserv_pam_otp
6 changes: 3 additions & 3 deletions tasks/variables.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
- name: Check oc_default_domain variable
fail:
ansible.builtin.fail:
msg: "Bailing out: ocserv_default_domain is not set"
when: ocserv_default_domain|length == 0

- name: Check ocserv_cl_network.ipv4 variable
fail:
ansible.builtin.fail:
msg: "Bailing out: ocserv_cl_network.ipv4 is not set"
when: ocserv_cl_network.ipv4|length == 0

- name: Check ocserv_routes variable
fail:
ansible.builtin.fail:
msg: "Bailing out: ocserv_routes is not set"
when: ocserv_routes|length == 0

0 comments on commit 3d44fff

Please sign in to comment.