Getting an error message when running my first playbook. I created a playbook to apply patch on multiple hosts.
---
- hosts: server01
vars:
jboss_home: /apps/middleware/jboss-eap-7.1
patch_file: patch_url
patch_dest: /apps/middleware/jboss-eap-7.1
patch_version: 7.1.3
tasks:
- name: Copy patch to target host
copy:
src: "{{ patch_file }}"
dest: "{{ patch_dest }}/{{ patch_file }}"
- name: Check applied patches
command: "jboss-cli.sh 'patch history'"
register: result
changed_when: "False"
- name: Apply patch
command: "jboss-cli.sh 'patch apply {{ patch_dest }}/{{ patch_file }}'"
when: patch_version not in result.stdout
Output
Fatal error PLAY [server1] ****************************************************************************************** TASK [Gathering Facts] *********************************************************************************************************** ok: [server1] TASK [Copy patch to target host] ************************************************************************************************* An exception occurred during task execution. To see the full traceback, use -vvv. The error was:
/apps/middleware/ansible/environments/dev/jboss/patching/patch_url fatal: [server1]: FAILED! => {"changed": false, "msg": "Could not find or access 'patch_url'\nSearched in:\n\t/apps/middleware/ansible/environments/dev/jboss/patching/files/patch_url\n\t/apps/middleware/ansible/environments/dev/jboss/patching/patch_url\n\t/apps/middleware/ansible/environments/dev/jboss/patching/files/patch_url\n\t/apps/middleware/ansible/environments/dev/jboss/patching/patch_url"} to retry, use: --limit @/apps/middleware/ansible/environments/dev/jboss/patching/jboss_patching.retry
Could not find or access 'patch_url'
thecopy
module can't find this file. – Baptiste Mille-Mathias