From 9094908c36d24017d354806d9d2adfd86074bf45 Mon Sep 17 00:00:00 2001 From: Olli Graf Date: Thu, 22 Jul 2021 09:31:32 +0200 Subject: [PATCH] =?UTF-8?q?Role=20f=C3=BCr=20ping=20updateservers=20f?= =?UTF-8?q?=C3=BCr=20Remoteserver?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts | 41 ++++++++++++++++++++++++++++++ ping.yml | 7 +++++ roles/ping/tasks/main.yml | 5 ++++ roles/updateservers/tasks/main.yml | 8 ++++++ updateservers.yml | 7 +++++ 5 files changed, 68 insertions(+) create mode 100644 ping.yml create mode 100644 roles/ping/tasks/main.yml create mode 100644 roles/updateservers/tasks/main.yml create mode 100644 updateservers.yml diff --git a/hosts b/hosts index ee18095..e6a66ae 100644 --- a/hosts +++ b/hosts @@ -16,3 +16,44 @@ all: ansible_user: pi ansible_ssh_common_args: '-o StrictHostKeyChecking=no' ansible_ssh_private_key_file: ~/.ssh/id_rsa +blini: + hosts: + quimby + vars: + ansible_python_interpreter: /usr/bin/python3 + ansible_connection: ssh + ansible_sudo: true + ansible_become: true + ansible_user: pi + ansible_ssh_common_args: '-o StrictHostKeyChecking=no' + ansible_ssh_private_key_file: ~/.ssh/id_rsa +frinks: + hosts: + frink00: + frink01: + frink02: + frink03: + vars: + ansible_python_interpreter: /usr/bin/python3 + ansible_connection: ssh + ansible_sudo: true + ansible_become: true + ansible_user: pi + ansible_ssh_common_args: '-o StrictHostKeyChecking=no' + ansible_ssh_private_key_file: ~/.ssh/id_rsa +servers: + hosts: + ollital.de: + vasmani.de: + ollital.net: + ashkente.de: + vars: + ansible_python_interpreter: /usr/bin/python3 + ansible_connection: ssh + ansible_port: 1770 + ansible_sudo: true + ansible_become: true + ansible_user: olli + ansible_ssh_common_args: '-o StrictHostKeyChecking=no' + ansible_ssh_private_key_file: ~/.ssh/id_rsa + diff --git a/ping.yml b/ping.yml new file mode 100644 index 0000000..b40bb77 --- /dev/null +++ b/ping.yml @@ -0,0 +1,7 @@ +--- +- hosts: "{{ target }}" + gather_facts: false + remote_user: pi + roles: + - ping + diff --git a/roles/ping/tasks/main.yml b/roles/ping/tasks/main.yml new file mode 100644 index 0000000..352878c --- /dev/null +++ b/roles/ping/tasks/main.yml @@ -0,0 +1,5 @@ +- name: Blini Test + become_user: pi + command: ping -c2 ollital.de + + diff --git a/roles/updateservers/tasks/main.yml b/roles/updateservers/tasks/main.yml new file mode 100644 index 0000000..2ec3a7d --- /dev/null +++ b/roles/updateservers/tasks/main.yml @@ -0,0 +1,8 @@ +- name: Servers aktualisieren + become: true + apt: + upgrade: dist + update_cache: yes + cache_valid_time: 86400 + autoremove: yes + diff --git a/updateservers.yml b/updateservers.yml new file mode 100644 index 0000000..f6f0448 --- /dev/null +++ b/updateservers.yml @@ -0,0 +1,7 @@ +--- +- hosts: "{{ target }}" + gather_facts: false + remote_user: olli + roles: + - updateservers +