====== Ansible ======
===== Vorraussetzungen =====
* ~/ansible/.ssh/ansible Key ist vorhanden
* ~/ansible/.ssh/root Key ist vorhanden
* Ansible Konfiguration:
[defaults]
remote_user = ansible
private_key_file = ~/ansible/.ssh/ansible
* Proxmox: Container TemplateTest-CT klonen
* Proxmox: Maschine > Netzwerk > IPv4-Adresse anpassen
* Zugang für root über ssh ist dann möglich
* SSH Server einmal neu starten:
root@server:~# systemctl restart sshd
* Neuen Host in das Inventory aufnehmen:
server ansible_host=192.168.178.19
* Skript debansstrap.sh kopieren:
user@pc:~ansible$ scp [-P 55] debansstrap.sh root@192.168.178.19:/root/debansstrap.sh
user@pc:~ansible$ ssh root@192.168.178.19 [-p 55]
root@server:~# chmod ugo+x debansstrap.sh
root@server:~# ./debansstrap
root@server:~# exit
user@pc:~ansible$ ssh ansible@192.168.178.19 -i .ssh/ansible [-p 55]
ansible@server:~$ exit
===== Zugang testen =====
user@pc:~ansible$ ansible '*' -i inventory.ini -m ping
===== root SSH-Konfiguration erstellen =====
user@pc:~ansible$ ansible-playbook -i inventory.ini -l lamp-ct myroot.yml
===== Links =====
* [[https://www.heise.de/select/ct/2021/7/2103309405832260834|Formgebung - Grundlagen zur Automatisierung mit Ansible / c'T]]
* [[https://www.heise.de/select/ct/2021/7/2104816154075366830|Ansible-Strap - Schnellstart ins Konfigurationsmanagementsystem Ansible / c'T]]
* [[https://ct.de/yx3v|Ansible-Strap - Dateien / c'T]]
* [[https://github.com/Pirmann-Media/ansible-playbooks/tree/main| Ansible Playbooks von Johannes Pirmann]]
* [[https://halvar.at/linux/cloud_server_installation_hetzner/|Installation eines Cloud Servers (vServer) von Hetzner mit Ubuntu Linux, Ansible, Docker und Portainer]]