FreeBSD allows a different root path (with '-R') or a different /etc path (with '-V') to be passed to pw to allow adding and modifying users and groups in different locations i.e. FreeBSD jails on the server.
In my setup there are multiple FreeBSD jails on a server that all get their base system (read-only mounted) from a slightly modified local FreeBSD installation. One of the slight modifications is to have a couple of users and groups added to the base which would be greatly simplified by having at least one of the mentioned options available.
pw is already used by the user and group modules if ansible is running on FreeBSD and every pw command can be combined with the '-R /different/root' flag, so implementation shouldn't be to difficult.
STEPS TO REPRODUCE
- name: make sure www user exists in basejail
user: name=www state=present rootdir=/jail/basejail
- name: make sure postfix group exists in basejail
group: name=postfix state=present rootdir=/jail/basejail
EXPECTED RESULTS
The user module should invoke 'pw -R /jail/basejail useradd -n www' if the user doesn't exists in /jail/basejail/etc/passwd.
And the group module should invoke 'pw -R /jail/basejail groupadd -n postfix'.
ISSUE TYPE
COMPONENT NAME
user core module group core module
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
FreeBSD allows a different root path (with '-R') or a different /etc path (with '-V') to be passed to pw to allow adding and modifying users and groups in different locations i.e. FreeBSD jails on the server. In my setup there are multiple FreeBSD jails on a server that all get their base system (read-only mounted) from a slightly modified local FreeBSD installation. One of the slight modifications is to have a couple of users and groups added to the base which would be greatly simplified by having at least one of the mentioned options available. pw is already used by the user and group modules if ansible is running on FreeBSD and every pw command can be combined with the '-R /different/root' flag, so implementation shouldn't be to difficult.
STEPS TO REPRODUCE
EXPECTED RESULTS
The user module should invoke 'pw -R /jail/basejail useradd -n www' if the user doesn't exists in /jail/basejail/etc/passwd. And the group module should invoke 'pw -R /jail/basejail groupadd -n postfix'.
ACTUAL RESULTS
At the moment there is no way to do this.