Merging dicts in Ansible

Posted on Wed 27 April 2022 in Sysadmin • Tagged with ansible

I spent way to much time figuring out this simple problem. In Ansible I wanted to have a top-level dict variable in the inventory that could be overridden by a host-level dict.

Example inventory file:

all:
  vars:
    dict1:
      thing1: stuff
      thing2: more stuff
  children:
    some_machines:
      hosts:
        server-a:
        server-b:
          dict1:
            thing1 …

Continue reading

Setting a global MAILTO environment variable in Cron

Posted on Wed 27 April 2022 in Sysadmin • Tagged with linux

On Debian/Ubuntu sysetems you can set MAILTO in /etc/environment(nor in /etc/default/cron, nor in systemd unit files with DefaultEnvironment) and have it apply to all of your crontabs. MAILTO(among other Cron "environment" variables) must be set within the crontab itself. This dissapoints.

If there is …


Continue reading