Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kazauwa committed Mar 16, 2024
1 parent be2bee2 commit 2510b05
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ headscale_directories:
- '{{ headscale_pid_dir }}'

headscale_config: {}
headscale_config_template: ""
headscale_config_template: ''
headscale_acl: {}
headscale_users: []
headscale_enable_routes: []
Expand Down
4 changes: 2 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ galaxy_info:
author: kazauwa
description: Headscale control server for tailscale.
issue_tracker_url: https://github.com/kazauwa/ansible-role-headscale/issues
license: "MIT"
min_ansible_version: "2.10"
license: 'MIT'
min_ansible_version: '2.10'
platforms:
- name: EL
versions:
Expand Down
22 changes: 11 additions & 11 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
- name: Copy configuration file
when: headscale_config
ansible.builtin.copy:
content: "{{ headscale_config | to_yaml }}"
dest: "{{ headscale_config_dir }}/config.yaml"
owner: "{{ headscale_user_uid }}"
group: "{{ headscale_user_gid }}"
mode: "0600"
content: '{{ headscale_config | to_yaml }}'
dest: '{{ headscale_config_dir }}/config.yaml'
owner: '{{ headscale_user_uid }}'
group: '{{ headscale_user_gid }}'
mode: '0600'
notify: reload headscale

- name: Copy configuration file template
when: headscale_config_template
ansible.builtin.template:
src: "{{ headscale_config_template }}"
dest: "{{ headscale_config_dir }}/config.yaml"
owner: "{{ headscale_user_uid }}"
group: "{{ headscale_user_gid }}"
mode: "0600"
src: '{{ headscale_config_template }}'
dest: '{{ headscale_config_dir }}/config.yaml'
owner: '{{ headscale_user_uid }}'
group: '{{ headscale_user_gid }}'
mode: '0600'
notify: reload headscale

- name: Copy ACL policies file
Expand All @@ -25,7 +25,7 @@
dest: '{{ headscale_config_dir }}/acl.yaml'
owner: '{{ headscale_user_uid }}'
group: '{{ headscale_user_gid }}'
mode: 0600
mode: '0600'
notify: reload headscale

- name: Ensure predefined users exist
Expand Down
4 changes: 4 additions & 0 deletions tasks/enable_routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
loop: '{{ headscale_enable_routes }}'
loop_control:
label: '{{ item.comment | default(item) }}'
register: enable_routes_result
changed_when: enable_routes_result.stdout == ''
when: not ansible_check_mode

- name: Enable exit nodes
Expand All @@ -13,4 +15,6 @@
loop: '{{ headscale_exit_nodes }}'
loop_control:
label: '{{ item.comment | default(item) }}'
register: enable_exit_nodes_result
changed_when: enable_exit_nodes_result.stdout == ''
when: not ansible_check_mode
8 changes: 4 additions & 4 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
dest: '{{ headscale_binary_path }}'
owner: '{{ headscale_user_uid }}'
group: '{{ headscale_user_gid }}'
mode: 0770
mode: '0770'
notify: restart headscale

- name: Ensure headscale directories exist
Expand All @@ -30,7 +30,7 @@
state: directory
owner: '{{ headscale_user_name }}'
group: '{{ headscale_user_group }}'
mode: 0755
mode: '0755'
loop: '{{ headscale_directories }}'

- name: Ensure sqlite exists
Expand All @@ -39,7 +39,7 @@
state: touch
owner: '{{ headscale_user_uid }}'
group: '{{ headscale_user_gid }}'
mode: 0600
mode: '0600'
modification_time: preserve
access_time: preserve

Expand All @@ -49,5 +49,5 @@
dest: '/etc/systemd/system/headscale.service'
owner: '{{ headscale_user_uid }}'
group: '{{ headscale_user_gid }}'
mode: 0600
mode: '0600'
notify: restart headscale
9 changes: 6 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
---
- ansible.builtin.import_tasks: install.yml
- name: Install headscale binary
ansible.builtin.import_tasks: install.yml
tags:
- headscale
- headscale-install

- ansible.builtin.import_tasks: configure.yml
- name: Configure headscale
ansible.builtin.import_tasks: configure.yml
tags:
- headscale
- headscale-configure

- ansible.builtin.import_tasks: enable_routes.yml
- name: Optional | Enable advertised routes
ansible.builtin.import_tasks: enable_routes.yml
tags:
- headscale
- headscale-routes

0 comments on commit 2510b05

Please sign in to comment.