From: nicoo Date: Tue, 14 Nov 2017 23:01:05 +0000 (+0100) Subject: Get ansible running without hardcoding admin-specific SSH config X-Git-Url: https://git.realraum.at/?p=noc.git;a=commitdiff_plain;h=e116938bfb30888451f8c4717e400a7654fc29bd Get ansible running without hardcoding admin-specific SSH config --- diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index 9f97815..d4921c2 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -1,6 +1,5 @@ [defaults] inventory = ./hosts -remote_user = root log_path = ./log nocows=1 vault_password_file = ./gpg/get-vault-pass.sh @@ -10,4 +9,4 @@ var_compression_level = 9 [ssh_connection] pipelining = True -ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s -F ssh/config +ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s diff --git a/ansible/hosts b/ansible/hosts index bae7f1e..f7fb9da 100644 --- a/ansible/hosts +++ b/ansible/hosts @@ -1,20 +1,25 @@ +[all:vars] +host_domain=realraum.at +ansible_host={{ inventory_hostname }}.{{ host_domain }} +ansible_user=root + [baremetalservers] -alfred +alfred.mgmt [kvmhosts] -alfred +alfred.mgmt [virtualservers] athsdisc -calendar +calendar.mgmt ctf entrance -galley -hacksch -metrics -r3home -tickets -tools +galley.mgmt +hacksch.mgmt +metrics.mgmt +r3home.mgmt +tickets.mgmt +tools.mgmt [servers:children] baremetalservers @@ -27,8 +32,8 @@ wuerfel [alix] gw -torwaechter +torwaechter.mgmt -[apu] -gnocchi1 -gnocchi2 +#[apu] +#gnocchi1 +#gnocchi2 diff --git a/ansible/ssh/config b/ansible/ssh/config deleted file mode 100644 index 6f6b776..0000000 --- a/ansible/ssh/config +++ /dev/null @@ -1,98 +0,0 @@ -Ciphers aes256-ctr,aes128-ctr,aes256-gcm@openssh.com,aes128-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-cbc,aes128-cbc -Macs hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160 - -Host * - IdentityFile ~/.ssh/id_r3_rsa - IdentitiesOnly yes - PasswordAuthentication no - -Host gw - Hostname gw.realraum.at - Port 22000 - -Host gnocchi1 - Hostname gnocchi1.realraum.at - -Host gnocchi2 - Hostname gnocchi2.realraum.at - -Host torwaechter - Hostname torwaechter.mgmt.realraum.at - User realraum - Port 22000 - -Host tuer - Hostname torwaechter.mgmt.realraum.at - Port 22000 - User tuerctl - -Host licht - Hostname licht.realraum.at - Port 22000 - User realraum - -Host ap - Hostname ap.mgmt.realraum.at - Port 22000 - User root - -Host ap5 - Hostname ap5.mgmt.realraum.at - Port 22000 - User root - -Host alfred - Hostname alfred.mgmt.realraum.at - Port 22000 - -Host ipa - Hostname ipa.mgmt.realraum.at - Port 22000 - -Host tickets - Hostname tickets.mgmt.realraum.at - Port 22000 - -Host home - Hostname r3home.mgmt.realraum.at - Port 22000 - -Host hacksch - Hostname hacksch.mgmt.realraum.at - Port 22000 - -Host entrance - Hostname entrance.mgmt.realraum.at - Port 22000 - -Host ctf - Hostname ctf.realraum.at - Port 22000 - -Host cal - Hostname calendar.mgmt.realraum.at - Port 22000 - -Host tools - Hostname tools.realraum.at - Port 22000 - -Host galley - Hostname galley.mgmt.realraum.at - Port 22000 - -Host metrics - Hostname metrics.mgmt.realraum.at - Port 22000 - -Host athsdisc - Hostname athsdisc.realraum.at - Port 22000 - -Host wuerfel - Hostname wuerfel.realraum.at - Port 22000 - -Host vex - HostName vex.realraum.at - Port 2342