ansible VRF aware on builtins for Ubuntu linux with VRFs

23 Views Asked by At

I enabled VRFs and can get things to work if I run commands in shell. I have to prepend all of the commands with "ip vrf and DNS works just fine. I can do some minor alias settings in .bashrc but those do not override commands when using the full path to the executable.

I can make an alias apt-get="ip vrf exec <VRF_NAME> /usr/bin/apt-get" and it works.

-vvv when running an ansible playbook shows that the command being run is /usr/bin/apt-get. Since neither apt or ansible are vrf aware, there seems to be no way to automate this without using ansible.builtin.shell.

Has anyone found a solution to this?

I tried using ansible and I tried using alias settings. I was expecting apt-get to work.

0

There are 0 best solutions below