Skip to content

Instantly share code, notes, and snippets.

@bhcopeland
Last active August 29, 2015 14:17
Show Gist options
  • Save bhcopeland/3a196cc1fb968eeb5f03 to your computer and use it in GitHub Desktop.
Save bhcopeland/3a196cc1fb968eeb5f03 to your computer and use it in GitHub Desktop.
Ensures a option is in fstab using ansible. In this case nobootwait and noatime
- name: Ensure fstab uses nobootwait and noatime
mount:
name: "{{ item.mount }}"
src: "{{ item.device }}"
fstype: "{{ item.fstype }}"
opts: "{{ item.options.split(',') | union(['nobootwait','noatime']) | join(',') }}"
state: present
with_items: ansible_mounts
when: item.options.find("nobootwait") == -1 or item.options.find("noatime") == -1
tags:
- fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment