# find command ambiguity

**URL:** <https://forum.ansible.com/t/find-command-ambiguity/18934>\
**Category:** Ansible Project\
**Created:** [August 4, 2015, 12:44pm UTC](https://forum.ansible.com/t/find-command-ambiguity/18934 "2015-08-04T12:44:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [August 4, 2015, 12:44pm UTC](https://forum.ansible.com/t/find-command-ambiguity/18934/1 "2015-08-04T12:44:46Z")

</div>

Hi Everyone, I have an ambiguity in the find command. Can somebody clarify it. I have paste the tasks down(copy from some blog post on the net). I have an ambiguity in the second task where it says

reboot\_hint.stdout.find(“reboot”) != -1

What does it mean, that run this task if you will not find the “reboot” word in the value of reboot\_init variable?  
OR  
run this task if you will find the “reboot” word in the value of reboot\_init variable?

Thanks in advance

```auto
- name: Check for reboot hint.
  shell: if [$(readlink -f /vmlinuz) != /boot/vmlinuz-$(uname -r)]; then echo 'reboot'; else echo 'no'; fi
  ignore_errors: true
  register: reboot_hint

- name: Rebooting ...
  command: shutdown -r now "Ansible kernel update applied"
  async: 0
  poll: 0
  ignore_errors: true
  when: kernelup|changed or reboot_hint.stdout.find("reboot") != -1
  register: rebooting

- name: Wait for thing to reboot...
  pause: seconds=45
  when: rebooting|changed

```

---

<div class="post-metadata">

**Author:** ![Scott\_Sturdivant](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Scott\_Sturdivant](https://forum.ansible.com/u/Scott_Sturdivant)\
**Post date:** [August 4, 2015, 1:33pm UTC](https://forum.ansible.com/t/find-command-ambiguity/18934/2 "2015-08-04T13:33:33Z")

</div>

It means that the task will run if it does find the string ‘reboot’ in the stdout of the registered reboot\_hint variable. It’s just calling this: [https://docs.python.org/2/library/string.html#string.find](https://docs.python.org/2/library/string.html#string.find)
