Skip to content

Commit

Permalink
solve ansible-lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Bergruebe committed Apr 12, 2024
1 parent 1923b5c commit fc98131
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 21 deletions.
7 changes: 7 additions & 0 deletions .config/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

use_default_rules: true

skip_list:
- yaml[line-length]
- unnamed-task
3 changes: 1 addition & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ wallabag_identifier: wallabag
wallabag_hostname: ''



wallabag_uid: ''
wallabag_gid: ''

Expand Down Expand Up @@ -194,4 +193,4 @@ wallabag_hsts_preload_enabled: false
# wallabag_container_labels_additional_labels: |
# my.label=1
# another.label="here"
wallabag_container_labels_additional_labels: ''
wallabag_container_labels_additional_labels: ''
12 changes: 6 additions & 6 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
mode: 0700
mode: "0700"
owner: "{{ wallabag_uid }}"
group: "{{ wallabag_gid }}"
with_items:
Expand All @@ -21,12 +21,12 @@
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
mode: 0755
mode: "0755"
owner: "{{ wallabag_uid }}"
group: "{{ wallabag_gid }}"
with_items:
- {path: "{{ wallabag_data_path }}", when: true}
- {path: "{{wallabag_images_path }}", when: true}
- {path: "{{ wallabag_images_path }}", when: true}


- name: Ensure wallabag traefik labels are installed
Expand All @@ -35,15 +35,15 @@
dest: "{{ wallabag_config_path }}/labels"
owner: "{{ wallabag_uid }}"
group: "{{ wallabag_gid }}"
mode: 0640
mode: "0640"

- name: Ensure wallabag configuration is deployed
ansible.builtin.template:
src: "{{ role_path }}/templates/env.j2"
dest: "{{ wallabag_config_path }}/env"
owner: "{{ wallabag_uid }}"
group: "{{ wallabag_gid }}"
mode: 0640
mode: "0640"

- name: Ensure wallabag container image is pulled
community.docker.docker_image:
Expand All @@ -54,4 +54,4 @@
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/wallabag.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/{{ wallabag_identifier }}.service"
mode: 0644
mode: "0644"
20 changes: 10 additions & 10 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---

- block:
- when: wallabag_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"

- when: wallabag_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/install.yml"
- name: Validate and install Wallabag if enabled
when: wallabag_enabled | bool
tags:
- setup-all
- setup-wallabag
- install-all
- install-wallabag
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/install.yml"

- block:
- when: not wallabag_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/uninstall.yml"
- name: Uninstall Wallabag if not enabled
when: not wallabag_enabled | bool
tags:
- setup-all
- setup-wallabag
- setup-wallabag
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/uninstall.yml"
2 changes: 1 addition & 1 deletion tasks/uninstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
- name: Ensure wallabag base path is files deleted (make sure to delete node data)
ansible.builtin.file:
path: "{{ wallabag_base_path }}"
state: absent
state: absent
2 changes: 1 addition & 1 deletion tasks/validate_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
You need to define a required configuration setting (`{{ item }}`) to correctly set up email via SMTP.
when: "wallabag_mailer_dsn !='' and vars[item] == ''"
with_items:
- wallabag_smtp_from
- wallabag_smtp_from
2 changes: 1 addition & 1 deletion templates/wallabag.service.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=wallabag readlater Server ({{ wallabag_identifier }})
Description=wallabag save websites to read them later ({{ wallabag_identifier }})
{% for service in wallabag_systemd_required_services_list %}
Requires={{ service }}
After={{ service }}
Expand Down

0 comments on commit fc98131

Please sign in to comment.