-
-
Save influx6/0bb9e3211dd647726218b62bdf2d77f4 to your computer and use it in GitHub Desktop.
I am having trouble making the mount command here idempotent. I think it should work the way I've written it, but it isn't.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# I want to verify that /dev/pts is mounted, and if not, mount it. | |
# Manually, this is simply: mount devpts /dev/pts -t devpts | |
# I want the resulting playbook to be idempotent and support the --check flag | |
- hosts: test | |
remote_user: testroot | |
tasks: | |
# The simple "command" way to do this. | |
- name: mount devpts with command module (this is idempotent thanks to the creates bit but command does not support --check) | |
command: "mount devpts /dev/pts -t devpts" | |
args: | |
creates: /dev/pts/ptmx | |
# The better way to do this, with the "mount" module. | |
- name: mount devpts with mount module (not idempotent, --check says changed every time) | |
mount: | |
path: /dev/pts | |
src: devpts # I think this could be the issue but unsure how to best do this | |
fstype: devpts | |
state: present | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment