Bladeren bron

Merge pull request #154 from cschug/fix_undefined_hosts

fix: ensure `hosts` definition is always defined
Christoph Schug 1 jaar geleden
bovenliggende
commit
4111c147f3

+ 1 - 1
ansible/configuration/fail2ban/config-f2b-protect-sshd.yaml

@@ -1,6 +1,6 @@
 ---
 - name: install fail2ban and configure sshd
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
   - name: install fail2ban

+ 1 - 1
ansible/configuration/ssh/config-add-sshkey.yaml

@@ -1,6 +1,6 @@
 ---
 - name: add ssh key
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
   - name: install public keys

+ 1 - 1
ansible/deployment/portainer/deploy-portainer.yaml

@@ -1,6 +1,6 @@
 ---
 - name: deploy portainer-ce latest
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   become_user: "{{ lookup('env','USER') }}"
   tasks:

+ 1 - 1
ansible/deployment/traefik/deploy-traefik.yaml

@@ -1,6 +1,6 @@
 ---
 - name: deploy traefik v2.5
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
   - name: deploy traefik

+ 1 - 1
ansible/installation/inst-core.yaml

@@ -1,5 +1,5 @@
 - name: install core packages
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
   - name: install core packages

+ 1 - 1
ansible/installation/inst-docker-ubuntu.yaml

@@ -1,6 +1,6 @@
 ---
 - name: install docker
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
     - name: install docker dependencies

+ 1 - 1
ansible/installation/inst-microk8s.yaml

@@ -1,6 +1,6 @@
 ---
 - name: install microk8s
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
     - name: install microk8s

+ 1 - 1
ansible/installation/inst-vm-core.yaml

@@ -1,6 +1,6 @@
 ---
 - name: install core packages for virtual machines
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
   - name: install packages

+ 1 - 1
ansible/installation/inst-wireguard.yaml

@@ -1,6 +1,6 @@
 ---
 - name: install wireguard
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
     - name: install wireguard

+ 1 - 1
ansible/installation/inst-zsh.yaml

@@ -1,6 +1,6 @@
 ---
 - name: install zsh
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
     - name: install zsh

+ 1 - 1
ansible/maintenance/maint-diskspace.yaml

@@ -1,6 +1,6 @@
 ---
 - name: check disk space
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   tasks:
     - name: get disk usage
       ansible.builtin.command: df -h

+ 1 - 1
ansible/maintenance/maint-docker-clean.yaml

@@ -1,6 +1,6 @@
 ---
 - name: clean docker
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   tasks:
     - name: prune non-dangling images
       community.docker.docker_prune:

+ 1 - 1
ansible/maintenance/maint-reboot-required.yaml

@@ -1,6 +1,6 @@
 ---
 - name: check if system reboot is required
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
     - name: check if system reboot is required

+ 1 - 1
ansible/maintenance/maint-reboot.yaml

@@ -1,6 +1,6 @@
 ---
 - name: reboot machine
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
   become: yes
   tasks:
   - name: reboot machine

+ 1 - 1
ansible/notification/notify-discord.yaml

@@ -11,7 +11,7 @@
 
 - name: notify discord
 
-  hosts: "{{ hosts }}"
+  hosts: "{{ my_hosts | d([]) }}"
 
   vars:
     # The name that will be shown as sender of the notification. Note