Open jezzirolk opened 1 year ago
Using the btrfs_subvolume module, when i try to create a subvolume nested under an existing subvolume that does not exist at the root. i get an error. it seems to be dropping the preceding directory for nested subvolumes.
Bug Report
btrfs_subvolume
$ ansible --version ansible [core 2.12.10] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/jezzirolk/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/jezzirolk/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0] jinja version = 2.10.1 libyaml = True
$ ansible-galaxy collection list community.general # /usr/lib/python3/dist-packages/ansible_collections Collection Version ----------------- ------- community.general 4.8.3 # /home/jezzirolk/.ansible/collections/ansible_collections Collection Version ----------------- ------- community.general 7.5.0
$ ansible-config dump --only-changed
Target OS: Ubuntu 23.10
- hosts: kessel become: yes tasks: - name: create /test1 subvol community.general.btrfs_subvolume: name: /test1 recursive: true - name: create /test1/a subvol (this works) community.general.btrfs_subvolume: name: /test/a recursive: true - name: create /test1/a/b subvol (this works) community.general.btrfs_subvolume: name: /test/a/b recursive: true - name: create directory /test2 file: path: /test2 state: directory - name: create /test2/a subvol (this works) community.general.btrfs_subvolume: name: /test2/a recursive: true - name: create /test2/a/b subvol (this fails) community.general.btrfs_subvolume: name: /test2/a/b recursive: true
subvolumes created at /test2/a/b
TASK [create /test2/a/b subvol (this fails)] ***************************************************************************************************************************************************************************************************************** fatal: [kessel]: FAILED! => {"changed": false, "cmd": "/usr/bin/btrfs subvolume create //a/b", "msg": "ERROR: cannot access '//a': No such file or directory", "rc": 1, "stderr": "ERROR: cannot access '//a': No such file or directory\n", "stderr_lines": ["ERROR: cannot access '//a': No such file or directory"], "stdout": "", "stdout_lines": []}
It seems from the failed commands that it is dropping the test2 directory from the dataset name.
Files identified in the description:
plugins/modules/btrfs_subvolume.py
If these files are incorrect, please update the component name section of the description or use the !component bot command.
component name
!component
click here for bot help
cc @gnfzdz click here for bot help
Summary
Using the btrfs_subvolume module, when i try to create a subvolume nested under an existing subvolume that does not exist at the root. i get an error. it seems to be dropping the preceding directory for nested subvolumes.
Issue Type
Bug Report
Component Name
btrfs_subvolume
Ansible Version
Community.general Version
Configuration
OS / Environment
Target OS: Ubuntu 23.10
Steps to Reproduce
Expected Results
subvolumes created at /test2/a/b
Actual Results
It seems from the failed commands that it is dropping the test2 directory from the dataset name.
Code of Conduct