linux/

Profile Ansible playbooks

Install profiling module:

ansible-galaxy collection install ansible.posix

Enable profiling in ansible.cfg in [defaults] section:

callback_whitelist = ansible.posix.profile_tasks
| 14 Feb 2022

Unable to start Podman containers in LXD

[root@fe ~]# podman run hello-world
ERRO[0000] 'overlay' is not supported over extfs at "/var/lib/containers/storage/overlay" 
Error: kernel does not support overlay fs: 'overlay' is not supported over extfs at "/var/lib/containers/storage/overlay": backing file system is unsupported for this graph driver

To fix this error, you’ll need to edit /etc/containers/storage.conf file and make sure that it contains the following options:

[storage]
driver = "overlay"
[storage.options]
mount_program = "/usr/bin/fuse-overlayfs"

Run the following command to verify the result:

podman --log-level=debug ps -a
| 5 Feb 2022

How to check which cipher suites are supported by a website

sudo dnf install sslscan
sslscan example.com
| 24 Jan 2022

Ansible: List all vars of the host

ansible stag-s4 -m debug -a "var=hostvars[inventory_hostname]"
| 18 Jan 2022

Change DNS nameservers using NetworkManager

sudo nmcli connection modify <connection name> ipv4.dns "1.1.1.1 8.8.8.8"

Apply changes:

sudo nmcli dev reapply <interface>
| 30 Dec 2021

How to reload the connection with NetworkManager

Reload interface configuration:

sudo nmcli connection reload

This command will ONLY make NetworkManager aware of new configuration changes. To apply the new changes, run the following command:

sudo nmcli dev reapply <interface>
| 30 Dec 2021

Wait until DNS propagates

until [[ -n $(dig new.mydomain.com A +short @1.1.1.1) ]]; do echo "waiting..." && sleep 5; done

-n flag stands for non-empty string

| 22 Dec 2021

Install module (collection) in Ansible

ansible-galaxy collection install containers.podman
| 21 Dec 2021

Rebase git branch on a different branch

git rebase --onto new_base old_base
| 20 Dec 2021

Log Varnish hash data

When starting Varnish, add -p vsl_mask=+Hash argument to the command. Print varnish logs with this command:

sudo varnishlog -n /opt/varnish -q 'ReqURL ~ "my_request"'
| 17 Dec 2021