I am working with the following script and I have got an error. Saying that 
your file is not found. Although my file is already there. 


What could be the possible problem ?


Script:

.....

cas_cloud.yml

--------------


---

- name: Create Cloudformation Template for Cassandra Servers

  hosts: awsserver

  gather_facts: no

  tasks:

     - name: Cloudformation | Cloudformation template location

       command: "echo 
/Users/suthata/Downloads/playbooks/ansible/cassandra.json"

       register: template_location

 

     - name: Cloudformation | Full path to cloudformation template

       debug: var=template_location.stdout

 

     - name: Cloudformation | Use the module cloudformation

       cloudformation:

         stack_name: "imdev-omniavpc-securitygroup"

         state: "present"

         region: "us-east-1"

         template: cassandra.json

       args:

         template_parameters:

           Environment: "imdev"

           VpcCidr: "10.123.0.0/16"

           VpcId: "vpc-4ec51e1b"

           VpcName: "omniavpc"

         tags:

           revision: "1.0"

           type: "security group"

 

*Output:*



PLAY [Create Cloudformation Template for Cassandra Servers] 
********************

 

TASK [Cloudformation | Cloudformation template location] 
***********************

changed: [52.90.52.201]

 

TASK [Cloudformation | Full path to cloudformation template] 
*******************

ok: [52.90.52.201] => {

    "changed": false, 

    "template_location.stdout": 
"/Users/suthata/Downloads/playbooks/ansible/cassandra.json"

}

 

TASK [Cloudformation | Use the module cloudformation] 
**************************

fatal: [52.90.52.201]: FAILED! => {"changed": false, "failed": true, "msg": 
"Traceback (most recent call last):\r\n  File 
\"/home/ec2-user/.ansible/tmp/ansible-tmp-1454356045.33-97534776320654/cloudformation\",
 
line 2535, in <module>\r\n    main()\r\n  File 
\"/home/ec2-user/.ansible/tmp/ansible-tmp-1454356045.33-97534776320654/cloudformation\",
 
line 273, in main\r\n    template_body = open(module.params['template'], 
'r').read()\r\nIOError: [Errno 2] No such file or directory: 
'cassandra.json'\r\n", "parsed": false}

 

PLAY RECAP 
*********************************************************************

52.90.52.201               : ok=2    changed=1    unreachable=0    failed=1  
 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/857cd25d-cae7-4967-8721-477e060c90bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to