diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-11-10 16:26:53 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-11-10 16:26:53 +0100 |
| commit | d1b3f8c46190baab08b648318ce7f0492d86b6c9 (patch) | |
| tree | d793535f937867fe09aa20d83e6a282284a06a53 /roles/pihole/tasks | |
| parent | 60f92a26d2a8bc706ad8a1b9afe2453ea528b355 (diff) | |
Fix running rpi configuration as root always
The dotfile/vim/password_store required to run as user with root
permissions, that's why reverting these changes on rpi and resolving to
using a more normal role (in pihole where it was broken)
Diffstat (limited to 'roles/pihole/tasks')
| -rw-r--r-- | roles/pihole/tasks/main.yml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/roles/pihole/tasks/main.yml b/roles/pihole/tasks/main.yml index 0d21fc07..a45a1482 100644 --- a/roles/pihole/tasks/main.yml +++ b/roles/pihole/tasks/main.yml @@ -16,12 +16,14 @@ when: pihole_dhcp_enabled - name: "Crete Pi-hole user" + become: true ansible.builtin.user: name: "pihole" system: true shell: "/usr/sbin/nologin" - name: "Create Pi-hole directories" + become: true ansible.builtin.file: path: "{{ item }}" state: "directory" @@ -33,6 +35,7 @@ - "/var/log/pihole" - name: "Create Pi-hole configuration file" + become: true ansible.builtin.template: src: "pihole.toml.j2" dest: "/etc/pihole/pihole.toml" @@ -58,6 +61,7 @@ when: not pihole_binary.stat.exists - name: "Run Pi-hole installer" + become: true ansible.builtin.command: cmd: "/tmp/install_pihole.sh --unattended" register: pihole_install @@ -72,6 +76,7 @@ var: pihole_install.stdout - name: "Ensure Pi-hole started/enabled" + become: true ansible.builtin.systemd_service: name: "pihole-FTL" enabled: true @@ -79,11 +84,13 @@ daemon_reload: true - name: "Update Pi-hole blocklists" + become: true ansible.builtin.command: cmd: "pihole -g" changed_when: false - name: "Configure pihole as system DNS" + become: true tags: # linking the systemd run files fails in molecule tests # This is not relevant to the testing itself, so it's safe to ignore |
