Skip to content

Commit

Permalink
Fix compatibility issue with newer librenms versions that do not have…
Browse files Browse the repository at this point in the history
… adduser.php and relocated librenms.nonroot.cron
  • Loading branch information
tobias-richter committed May 18, 2024
1 parent 790f1a7 commit 806291a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tasks/librenms-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
owner: "{{ librenms_user }}"
group: "{{ librenms_group }}"
recurse: true
tags:
- ownership

- name: "Apply permissions on {{ librenms_home }}"
ansible.builtin.file:
Expand Down Expand Up @@ -73,19 +75,25 @@
become: yes
tags:
- migrate
- daily_sh

- name: Initially set admin user password. # noqa 301
ansible.builtin.command: "./adduser.php {{ librenms_admin_user }} {{ librenms_admin_password }} 10"
ansible.builtin.command: "./lnms user:add --role admin --password={{ librenms_admin_password }} {{ librenms_admin_user }}"

Check warning on line 81 in tasks/librenms-install.yml

View workflow job for this annotation

GitHub Actions / lint & syntax check

yaml line too long (124 > 120 characters)
args:
chdir: "{{ librenms_home }}"
become_user: "{{ librenms_user }}"
become: yes
register: admin_user_result
changed_when: not admin_user_result.stdout is search("The username has already been taken")
failed_when:
- admin_user_result.rc != 0
- not admin_user_result.stdout is search("The username has already been taken")
tags:
- migrate

- name: Deploy cronjob
ansible.builtin.copy:
src: "{{ librenms_home }}/librenms.nonroot.cron"
src: "{{ librenms_home }}/dist/librenms.cron"
dest: /etc/cron.d/librenms
remote_src: true
mode: 0644
Expand Down

0 comments on commit 806291a

Please sign in to comment.