I'm trying to apply the docker rootless setup across all of our molecule tests so that missing privilege escalation on tasks is picked up earlier than actual deployment.
Since I want to apply this to all of my tests, I'd like to be able to make a change/define it in one place (e.g. somewhere like ~/.config/molecule/config.yml) as a default that could be overridden on a test-by-test basis. I can do this for the ansible_user, but the docker driver only looks for custom Dockerfile.j2 templates relative to the molecule scenario directory, and the path is picked up off platforms[*].dockerfile, so it's a little more awkward to do globally:
|
path: "{{ molecule_scenario_directory + '/' + (item.dockerfile | default('Dockerfile.j2')) }}" |
What do you think about adding the extra ansible user & sudo config to the default Dockerfile.j2? Either always applied (it shouldn't break the default behaviour of running as root) or behind some kind of flag that could be passed to the driver?
I'm trying to apply the docker rootless setup across all of our molecule tests so that missing privilege escalation on tasks is picked up earlier than actual deployment.
Since I want to apply this to all of my tests, I'd like to be able to make a change/define it in one place (e.g. somewhere like
~/.config/molecule/config.yml) as a default that could be overridden on a test-by-test basis. I can do this for theansible_user, but the docker driver only looks for customDockerfile.j2templates relative to the molecule scenario directory, and the path is picked up offplatforms[*].dockerfile, so it's a little more awkward to do globally:molecule-plugins/src/molecule_plugins/docker/playbooks/create.yml
Line 41 in 980db38
What do you think about adding the extra ansible user & sudo config to the default
Dockerfile.j2? Either always applied (it shouldn't break the default behaviour of running as root) or behind some kind of flag that could be passed to the driver?