diff --git a/hosts b/hosts index 9ec3568..44f36e3 100644 --- a/hosts +++ b/hosts @@ -1,9 +1,9 @@ # Consolidation of all groups [hosts:children] -pve01 +pve01_debian internet -[pve01] +[pve01_debian] fileserver01 ansible_host=192.168.10.52 checkmk ansible_host=192.168.10.53 pbs01 ansible_host=192.168.10.54 @@ -12,24 +12,27 @@ mail ansible_host=192.168.10.120 vserver01 ansible_host=192.168.10.180 seedbox ansible_host=192.168.20.10 aptcache ansible_host=192.168.50.10 +docker-dmz ansible_host=192.168.50.11 rustdesk ansible_host=192.168.50.12 radicale ansible_host=192.168.50.13 mumble ansible_host=192.168.50.14 freshrss ansible_host=192.168.50.17 owncloud ansible_host=192.168.50.18 +arrstack ansible_host=192.168.50.19 webserver01 ansible_host=192.168.50.19 webserver02 ansible_host=192.168.50.20 -gitea ansible_host=192.168.50.21 bookshelf ansible_host=192.168.50.22 syncthing ansible_host=192.168.50.24 sftpgo ansible_host=192.168.50.25 jellyfin ansible_host=192.168.60.20 adgurd ansible_host=192.168.178.10 + + [internet] strato ansible_host=85.215.43.109 -[pve01:vars] +[pve01_debian:vars] ansible_user=root ansible_port=22 ansible_python_interpreter=/usr/bin/python3 @@ -39,4 +42,4 @@ ansible_python_interpreter=/usr/bin/python3 ansible_user=root ansible_port=63007 ansible_python_interpreter=/usr/bin/python3 -#ansible_ssh_pass=password \ No newline at end of file +#ansible_ssh_pass=password diff --git a/playbooks/apt-dist.yml b/playbooks/apt-dist.yml index 8227b09..096d4dc 100644 --- a/playbooks/apt-dist.yml +++ b/playbooks/apt-dist.yml @@ -29,4 +29,4 @@ - name: Removes all packages from the package cache become: yes command: apt -y clean -... +... \ No newline at end of file diff --git a/playbooks/hosts-ping.yml b/playbooks/hosts-ping.yml new file mode 100644 index 0000000..f013860 --- /dev/null +++ b/playbooks/hosts-ping.yml @@ -0,0 +1,18 @@ +--- +- hosts: all + gather_facts: no + tasks: + - name: Ping all hosts + ping: + register: ping_result + ignore_errors: yes + + - name: Display success message + debug: + msg: "Successfully connected to {{ inventory_hostname }}" + when: ping_result is succeeded + + - name: Display failure message + debug: + msg: "Failed to connect to {{ inventory_hostname }}: {{ ping_result.msg if 'msg' in ping_result else 'Unknown error' }}" + when: ping_result is failed