Anonymous

Equipment/Denning: Difference between revisions

From London Hackspace Wiki
add new machine bootstrapping infos
(remove netboot stuff)
(add new machine bootstrapping infos)
Line 127: Line 127:
The dns stuff in /etc/network/interfaces appears to be bogus and resolv.conf needs to be
The dns stuff in /etc/network/interfaces appears to be bogus and resolv.conf needs to be
done manually, add to ansible.
done manually, add to ansible.
</nowiki>
=== Bootstrapping a new machine to a static ip ===
<nowiki>
Login to the new install and find it's ip, make sure you know the root password, or have an sshkey for the root account.
Choose a hostname for your new machine.
Log in to boole, and as root cd /etc/bind, and edit lan.london.hackspace.org.uk. and 24.31.172.in-addr.arpa. to add your new host, remember the new static ip you choose.
There is only a few static ip's left, you may end up needing to shrink the dhcp range and change the dhcpserver config on boole as well.
zkt-signer -v -r to sign and push out your changes.
Check that the hostname works in fwd and reverse dns.
and git commit your changes and log out of boole.
on denning edit /etc/ansible/hosts, add:
<ip> syslocation="something" lhs_host=<hostname>
to at least [lhshosts], you probably want [ldap-clients] as well, and maybe some other sections, depending on what you want.
then edit /etc/ansible/lhs/vars/defaults.yml , adding your host and the last octet of the new static ip to the hosts: section
now ssh to the host to check that ssh works:
ssh root@<ip>
You may need to fix old cached pub keys, and/or allowing root to ssh to your new machine with a password ( PermotRootLogin yes in /etc/ssh/sshd_config on the machine you are setting up).
Now you can run ansible. This example assumes you are using a password for root
cd /etc/ansible
ansible-playbook -l "<ip>" -k -u root lhs/site.yml
and hopefully ansible should run ok and set everything up!
Note that ansible will change the root password, hopefully you've got a way to get back in (either you are an admin in ansible, or in the Admins group in ldap, in either case you can login as yourself and then sudo).
Now reboot the new machine, it should come back with the static ip. double check that it's right.
Now edit /etc/ansible/hosts on denning again and in the entries you added earlier change <ip> to the machines new full hostname.
Now run ansible again (needed to fix the snmp config), if it's an ldap client you'll have to use your ldap password - (You could always add your ssh key to your account on the new machine).
git commit your changes on denning.
and you are done!


</nowiki>
</nowiki>