ee835ff does not fixed #11746 (posting here because the issue was closed)
Here is the play, pretty must the same as the play in #11746
- name: deploy ssl keys and certificates
copy: >
src={{ item }}
dest=/etc/ssl/private/
owner=root
group=ssl-cert
mode=0640
with_fileglob: - private/*.key
- private/*.crt
- z*
sudo: yes
tags: nagios
Example run
$ source hacking/env-setup
$ cd …/playbooks/
$ ansible-playbook -i vagrant_inventory --private-key private_key -u vagrant vagrant.yml -vv
PLAY ****************************************************************************
TASK [setup] ********************************************************************
ok: [default]
TASK [nagios-servers : deploy ssl keys and certificates] ************************
changed: [default] => {“changed”: true, “msg”: “All items completed”, “results”: [{“changed”: true, “checksum”: “e438cb27db8f5a95d30895eb026a4bc054a4880a”, “dest”: “/etc/ssl/private/zimbra-test.yml”, “gid”: 115, “group”: “ssl-cert”, “item”: “/Volumes/Warrior1TB/Users/tanner/projects/ansible.git/playbooks/zimbra-test.yml”, “md5sum”: “77192f7a54aef85b11ce8e6a56e21be7”, “mode”: “0640”, “owner”: “root”, “size”: 97, “src”: “/home/vagrant/.ansible/tmp/ansible-tmp-1438026036.31-70839668423767/source”, “state”: “file”, “uid”: 0}]}
Directory layout of the nagios-servers role
nagios-servers/defaults/main.yml
nagios-servers/files/private/nagios1.crt
nagios-servers/files/private/nagios1.key
nagios-servers/files/private/nagios2.crt
nagios-servers/files/private/nagios2.key
nagios-servers/files/zzzzz
nagios-servers/handlers/main.yml
nagios-servers/meta/main.yml
nagios-servers/README.md
nagios-servers/tasks/debian.yml
nagios-servers/tasks/main.yml
nagios-servers/templates/nagios3.j2
nagios-servers/vars/main.yml
You can see there are 2 keys and 2 certificates in the files/private/ directory but the with_fileglob: does not pick them up. But the with_fileglob: does pick up the zimbra-test.yml in the ansible.git/playbooks/ directory.
$ ansible --version
ansible 2.0.0 (devel 010e58ebfa) last updated 2015/07/27 14:37:44 (GMT -500)
lib/ansible/modules/core: (detached HEAD bc60c893f5) last updated 2015/07/27 14:37:45 (GMT -500)
lib/ansible/modules/extras: (detached HEAD 14fffa5b53) last updated 2015/07/24 12:24:44 (GMT -500)
v1/ansible/modules/core: (detached HEAD f8d8af17cd) last updated 2015/06/03 00:37:54 (GMT -500)
v1/ansible/modules/extras: (detached HEAD 495ad450e5) last updated 2015/06/03 00:37:58 (GMT -500)
config file =
configured module search path = None