Sometimes, there are just too many messages in journalctl output and it becomes a mystery game to search for the messages you are looking for. But luckily you do not need to use grep to find the right message. Here is example of what I had to do when I was looking for kernel messages.
# To see all the fields, you can use the verbose mode
journalctl _TRANSPORT=kernel -o verbose
# And the filter on priority if needed to get the messages you need
journalctl _TRANSPORT=kernel PRIORITY=4
# and follow
journalctl _TRANSPORT=kernel PRIORITY=4 -f -l
You should not get any errors or warnings and see a list of dockers running on your host. If you get error for docker-py then you can install the same with :
pip install docker-py
And now is the good time to open the docker.py script to check the documentation. It adds all the docker hosts as entry in itself. But cool thing I liked is the fact that it creates a group for all running dockers – which is very very useful.
Now, if I want to set the Timezone (TZ) on all the running dockers in one go, I can do this:
And just in case, the above does not work for you and you have a common username/password on all the machines, then another thing you would love is following:
# Export the docker host. If that is localhost, then you do not need this.
# This is GOOD to set option. This is the default IP address for docker
# and setting this to first IP address of the docker network is good idea
# that would ensure that ansible can login to each docker.
# And note - you need to have ssh running on all the dockers for the commands to work
ansible -i docker.py -m setup -u root -a 'filter=ansible_eth[0-2]' all
+++ TLP Status
State = enabled
Last run = 12:16:55 PM, 556 sec(s) ago
Mode = AC
Power source = AC
Notice: systemd-rfkill@.service is not masked — invoke “systemctl mask systemd-rfkill@.service” to correct this!
Notice: systemd-rfkill.service is not masked — invoke “systemctl mask systemd-rfkill.service” to correct this!