From aef588f3a3fa44be9a5d159e6cbfdf2486af439f Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Wed, 30 Nov 2016 17:11:21 +0000 Subject: [PATCH] Use native YAML (#3440) * Use native YAML * Add comment on quotes and column --- lib/ansible/modules/extras/system/crypttab.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/extras/system/crypttab.py b/lib/ansible/modules/extras/system/crypttab.py index b8834a23c8a..0565f57f9eb 100644 --- a/lib/ansible/modules/extras/system/crypttab.py +++ b/lib/ansible/modules/extras/system/crypttab.py @@ -73,12 +73,20 @@ author: "Steve (@groks)" ''' EXAMPLES = ''' + +# Since column is a special character in YAML, if your string contains a column, it's better to use quotes around the string - name: Set the options explicitly a device which must already exist - crypttab: name=luks-home state=present opts=discard,cipher=aes-cbc-essiv:sha256 + crypttab: + name: luks-home + state: present + opts: 'discard,cipher=aes-cbc-essiv:sha256' - name: Add the 'discard' option to any existing options for all devices - crypttab: name={{ item.device }} state=opts_present opts=discard - with_items: "{{ ansible_mounts }}" + crypttab: + name: '{{ item.device }}' + state: opts_present + opts: discard + with_items: '{{ ansible_mounts }}' when: '/dev/mapper/luks-' in {{ item.device }} '''