No. The chdir=
parameter to, e.g., the command
module does not support wildcards.
You could accomplish what you want using a register variable to store the output of the ls
command:
- shell: ls -d solr*
register: dir_name
- command: some_command
args:
chdir: "{{ dir_name.stdout }}"
But this is, frankly, an ugly solution. You're better off just using the actual directory name. If it differs on different hosts, you can use host variables to set it appropriately.