# platform = multi_platform_all
# reboot = false
# strategy = configure
# complexity = low
# disruption = medium

- name: "Get nfs and nfs4 mount points, that don't have {{{ MOUNTOPTION }}}"
  shell: grep -E "[[:space:]]nfs[4]?[[:space:]]" /etc/fstab | grep -v "{{{ MOUNTOPTION }}}" | awk '{print $2}'
  register: points_register
  check_mode: no
  changed_when: False
  tags:
    @ANSIBLE_TAGS@
  @ANSIBLE_ENSURE_PLATFORM@

- name: "Add {{{ MOUNTOPTION }}} to mount points"
  shell: awk '$2=="{{ item }}"{$4=$4",{{{ MOUNTOPTION }}}"}1' /etc/fstab > fstab.tmp && mv fstab.tmp /etc/fstab
  with_items:
    - "{{ points_register.stdout_lines }}"
  when: (points_register.stdout | length > 0) and @ANSIBLE_PLATFORM_CONDITION@
  tags:
    @ANSIBLE_TAGS@
