Skip to content
Snippets Groups Projects
Verified Commit caa4121f authored by anarcat's avatar anarcat
Browse files

add example query to list all *other* hosts than ganeti on reboot

parent 01bb26c3
No related branches found
No related tags found
No related merge requests found
Pipeline #182856 passed with warnings
...@@ -791,12 +791,12 @@ The currently known values are: `kvm`, `physical`, and `xenu`. ...@@ -791,12 +791,12 @@ The currently known values are: `kvm`, `physical`, and `xenu`.
* Using [howto/cumin](howto/cumin) * Using [howto/cumin](howto/cumin)
* Using LDAP: * Using LDAP:
ldapsearch -H ldap://db.torproject.org -x -ZZ -b "ou=hosts,dc=torproject,dc=org" '*' hostname | sed -n '/hostname/{s/hostname: //;p}' | sort
HOSTS=$(ssh alberti.torproject.org 'ldapsearch -H ldap://db.torproject.org -x -ZZ -b dc=torproject,dc=org -LLL "hostname=*.torproject.org" hostname | awk "\$1 == \"hostname:\" {print \$2}" | sort') Same, but only hosts not in a Ganeti cluster:
for i in `echo $HOSTS`; do mkdir hosts/x-$i 2>/dev/null || continue; echo $i; ssh $i ' ...'; done
the `mkdir` is so that I can run the same command in many terminal ldapsearch -H ldap://db.torproject.org -x -ZZ -b "ou=hosts,dc=torproject,dc=org" '(!(physicalHost=gnt-*))' hostname | sed -n '/hostname/{s/hostname: //;p}' | sort
windows and each host gets only one once
[PuppetDB API]: https://puppet.com/docs/puppetdb/4.3/api/index.html [PuppetDB API]: https://puppet.com/docs/puppetdb/4.3/api/index.html
[fact API]: https://puppet.com/docs/puppetdb/4.3/api/query/v4/facts.html [fact API]: https://puppet.com/docs/puppetdb/4.3/api/query/v4/facts.html
......
...@@ -320,7 +320,17 @@ See the [Ganeti reboot procedures](howto/ganeti#rebooting) for this procedure. ...@@ -320,7 +320,17 @@ See the [Ganeti reboot procedures](howto/ganeti#rebooting) for this procedure.
## Remaining nodes ## Remaining nodes
The [Nagios unhandled problems](https://nagios.torproject.org/cgi-bin/icinga/status.cgi?allunhandledproblems) will show remaining hosts that The [Nagios unhandled problems](https://nagios.torproject.org/cgi-bin/icinga/status.cgi?allunhandledproblems) will show remaining hosts that
might have been missed by the above procedure. might have been missed by the above procedure.
But if you want to run more upgrades in parallels and are doing a
fleet-wide reboot, while running the Ganeti reboots (above), you can
perform reboots on the hosts *not* on Ganeti cluster by pulling the
list of hosts from LDAP:
ldapsearch -H ldap://db.torproject.org -x -ZZ -b "ou=hosts,dc=torproject,dc=org" '(!(physicalHost=gnt-*))' hostname | sed -n '/hostname/{s/hostname: //;p}' | sort
... and then pick the hosts judiciously to avoid overlapping with
hosts in the same rotation currently rebooting in Ganeti.
## Userland reboots ## Userland reboots
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment