copy module failing path has wildcard ?????

Hi,

I am trying to copy a file from one location to other with copy module, on remote server

/puppeteer/.local-chromium/linux-782078/chrome-linux to /usr/local/sbin

linux.chrom_dir = /puppeteer/.local-chromium/linux-782078/chrome-linux

source file: chrome_sandbox
dest file: chrome-devel-sandbox

  • name: Copy chrome_sandbox to sbin directory
    copy:
    src: “{{ linux.chrom_dir }}/chrome_sandbox”
    dest: /usr/local/sbin/chrome-devel-sandbox
    remote_src: yes
    owner: root
    group: root
    mode: ‘4755’

if i changed the linux-782078 to linux-???,

Ansible terminating with path not found

fatal: [centos]: FAILED! => {“changed”: false, “msg”: “Source /puppeteer/.local-chromium/linux-???/chrome-linux/chrome_sandbox not found”}

It doesn’t find the directory so failed. You may can define that as a variable and try.

Hi Om,

The linux-782078, in the path created during the installation of puppeteer in previous step. It may change when there is a version update.

Hence i need to check and the version prior to run the play book. instead number if mentioned wildcard characters, I can simply run the playbook and no need to update the playbook every time.

Thanks
HARASAI