From c12279184dfb0e53c21e6d5db20603a55150312e Mon Sep 17 00:00:00 2001 From: Wolfgang Date: Sun, 9 Jan 2022 13:35:59 +0100 Subject: [PATCH] Photorpism cronjob fix, ansible-lint --- .yamllint | 15 +++++++++++++++ .../containers/services/photoprism/tasks/main.yml | 2 +- roles/system/tasks/essential.yml | 11 ++++++++--- roles/system/tasks/user.yml | 1 + 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 00000000..100372f0 --- /dev/null +++ b/.yamllint @@ -0,0 +1,15 @@ +--- +extends: default + +rules: + line-length: disable + truthy: + allowed-values: ['true', 'false', 'yes', 'no'] + comments: + min-spaces-from-content: 1 + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + +ignore: | + .cache \ No newline at end of file diff --git a/roles/containers/services/photoprism/tasks/main.yml b/roles/containers/services/photoprism/tasks/main.yml index 4947f0b8..e2853b0e 100644 --- a/roles/containers/services/photoprism/tasks/main.yml +++ b/roles/containers/services/photoprism/tasks/main.yml @@ -72,7 +72,7 @@ cron: name: Scan the PhotoPrism library hour: "1" - job: "/usr/bin/docker exec -it photoprism /photoprism/bin/photoprism index" + job: "/usr/bin/docker exec photoprism /photoprism/bin/photoprism index" - name: Add {{ container_name }} to the SWAG network (reverse-proxy) docker_network: diff --git a/roles/system/tasks/essential.yml b/roles/system/tasks/essential.yml index 6277087b..cab33500 100644 --- a/roles/system/tasks/essential.yml +++ b/roles/system/tasks/essential.yml @@ -47,12 +47,12 @@ - name: Reboot if required reboot: msg: Rebooting due to a kernel update - when: reboot_required_file.stat.exists == true + when: reboot_required_file.stat.exists - name: Install extra packages package: name: "{{ extra_packages }}" - state: latest + state: present - name: Clone the latest dotfiles repo git: @@ -94,11 +94,16 @@ file: name: /home/{{ username }}/.hushlogin state: touch + mode: 0664 modification_time: preserve access_time: preserve - name: Disable cron e-mail notifications cron: name: MAILTO + user: "{{ item }}" env: yes - job: "" \ No newline at end of file + job: "" + with_items: + - root + - "{{ username }}" \ No newline at end of file diff --git a/roles/system/tasks/user.yml b/roles/system/tasks/user.yml index f336aa3f..e8f81ae0 100644 --- a/roles/system/tasks/user.yml +++ b/roles/system/tasks/user.yml @@ -69,6 +69,7 @@ - name: Suppress login messages file: name: /home/{{ username }}/.hushlogin + mode: 0644 state: touch modification_time: preserve access_time: preserve