Somehow you are in check mode... I'd find out why. If you truly are checking things, you can do this:
http://docs.ansible.com/playbooks_checkmode.html#running-a-task-in-check-mode -d On Monday, December 8, 2014 9:20:15 PM UTC-8, Steven Truong wrote: > > Hi all, > > Here is the situation that I am not sure how to deal with it. > > shell: echo {{ ec2_tag_Name | regex_replace('(^[a-z]+-[a-z0-9]+).*', > '\\1') }} > > And certainly, I have other shell command where I echo something and use > register to capture the output such as the following: > > - name: get public ipv4 address > shell: curl http://169.254.169.254/latest/meta-data/public-ipv4 > register: public_ipv4 > > > So when I ran these in ansible_pull then these tasks worked just fine. > When I ran against the public_hostname of the EC2 instance with > > ansible-playbook myplaybookyml -i /usr/local/src/public_hostname > > where public_hostname in AWS has the public DNS entry of the instance and > I believe this entry will resolve to private IP address in AWS. This will > NOT work. > > ansible-playbook myplaybook.yml -i host.localhost > > where host.localhost has 'localhost" as the only entry and this will NOT > work either. > > ansible-playbook myplaybook.yml -i ec.py --limit $public_ip > > The public IP address is just the actual IP address of the instance. This > will work. > > For those 2 cases when things failed to work I did not get error message > but and OK with something like the following: > > ok: [a.b.c.c] => {"msg": "check mode not supported for shell", "skipped": > true} > > So shell module seemed to give me these message and fail to execute the > shell command at all in the case I use localhost or the public DNS name in > AWS that resolves to the private IP address. > > I ran these locally on the instance. > > Please share your thoughts on what could have been the case here. Bug or > security feature??? > > Thank you very much, > Steven > > > -- 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/e978b0b8-6f2b-47c3-97b5-1a62a9b37a79%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
