Closed bkus closed 1 year ago
The ansible portion looks reasonable.
The bit about using a predefined keypair I'm a bit unclear on what that was required, and not knowing the setup well leaves me with concerns it would end up being used in prod, but I may be entirely off base. Not enough insight to comment.
Not sure why 'eo' was chosen for hardcoded test/admin user, rather than a generic when moving away from the 'vagrant' user.
The ansible portion looks reasonable.
The bit about using a predefined keypair I'm a bit unclear on what that was required, and not knowing the setup well leaves me with concerns it would end up being used in prod, but I may be entirely off base. Not enough insight to comment.
The role populates keys, so I had to feed it some keys to satisfy the role.
Which keys are used is controlled by the override in roles/users/molecule/default/converge.yml. By default, the keys in roles/users/vars/main.yml are used. So the test keys are only used when running molecule itself. Production is safe.
Not sure why 'eo' was chosen for hardcoded test/admin user, rather than a generic when moving away from the 'vagrant' user.
The role doesn't control 'vagrant', it only controls the defined test users: eo, nigel, tom. I picked one at random ... or perhaps with some bias. ;) All 3 are admin users. It's just the one I chose to write the group migration test against. See the Vagrantfile to see how easy that can change to nigel or anyone else.
Introduced a new Vagrant target "test.group.change" to test the scenario of an admin user being in an outdated group (eg: hamwan), and being automatically moved to a new group (eg: hamadmin). The scenario injects multiple network failures, which exposes an unsafe sequencing of tasks. The admin user is locked out of network control, and the test fails.
In order to pull this off, I had to stop using production keys, and there's now a locally stored test key pair. Don't use it in prod or for anything else! The private key is stored in plaintext and distributed widely.
The Ansible admin user changed from "vagrant" to "eo". Vagrant user remains for true back-door access to the test target VMs.