'register' indented too much on your 'stat' task

On Sun, Jun 14, 2020 at 1:34 PM Tony Wong <[email protected]> wrote:

> any idea what is wrong with my playbook here?
>
>
> - name: Retrieve info about the mount directory
>   stat:
>     path: "{{ mount_dir_path }}"
>     register: mount_dir_stat_first
>   tags:
>     - prereqs
>
> # If the mount directory doesn't already exist it is created
> - name: Create the mount directory
>   become: yes
>   become_method: yes
>   file:
>     path: "{{ mount_dir_path }}"
>     state: directory
>     mode: 0777
>   become: yes
>   become_method: sudo
>   when: mount_dir_stat_first.stat.exists == False
>   tags:
>     - prereqs
> # We run stat again to get info about the mount directory post-creation.
> This info will be used
> #  within when statements to make sure that the directory exists and isn't
> already being used.
> #  It's a crude check and I would like to devise a better method.
> - name: Retrieve info about the mount directory
>   stat:
>    path: "{{ mount_dir_path }}"
>    register: mount_dir_stat_created
>   tags:
>     - prereqs
>
> - name: Mount the ISO
>   mount:
>     path: "{{ mount_dir_path }}"
>     src: "{{ repo_dir }}/{{ vcsa_iso}}"
>     fstype: iso9660
>     opts: ro,noauto
>     state: mounted
>     become: yes
>     become_method: sudo
>   when: mount_dir_stat_created.stat.wusr == True
>   tags:
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CALmkhkqJZ0_6yfqenCcS__XseHg_VZd3paV0%3Da6kOP0PVndAyg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CALmkhkqJZ0_6yfqenCcS__XseHg_VZd3paV0%3Da6kOP0PVndAyg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEgr%2BQCmHQme%2B84Ged1C9JMnBPg98XXaWYyKP_ndG3_Q0pm4yw%40mail.gmail.com.

Reply via email to