Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Set mount option for given mount point with ansible

I managed to get what I want with the json_query filter:

- name: "mount options for /"
  mount:
    path: "/"
    src: "UUID={{ ansible_mounts | json_query('[?mount == `/`] | [0].uuid') }}"
    fstype: "ext4"
    opts: "errors=remount-ro,noatime,user_xattr,acl"
    state: "present"

You will need to install the package python-jmespath.

Tags:

Linux

Mount

Ansible

Related

What does Alpine's APK stands for? isc dhcp class with more match Generating a self-signed cert with openssl that works in Chrome 58 Is it safe to use a UPS designed for desktop PCs to power a server? Service start request repeated too quickly, refusing to start limit How to install MSBuild 15.0 on Windows 2012 (Not R2) Upload a file from local machine to s3 bucket via cloudformation script write hole: which RAID levels are affected? WSGI : Truncated or oversized response headers received from daemon process OpenVPN reconnect after server restart Server wiped after "yum remove python" Can FindInMap return a list?

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy