using the storage promise

15 views
Skip to first unread message

Gregory Matthews

unread,
Oct 4, 2017, 12:44:18 PM10/4/17
to help-cfengine
I've just been playing around with the "storage" promise, we have been
using in-house code to edit /etc/fstab until now.

It works quite well but I was surprised by the fact I couldn't pass
double quotes in the options:

"/mnt" mount => nfs_p("host", "/path",
"context=\"unconfined_u:object_r:postgresql_db_t:s0\"");

(beware of line wrap above)

in this case the literal \" ends up in the fstab. I tried removing the
escape character and replacing the enclosing quotes with singles but
that also put \" into the fstab.

single quotes in the fstab are also illegal. In the end, I was able to
do away with quotes entirely but thought I'd mention it in case there is
a case where quotes are necessary.

I also found that I had to remove the lines from fstab entirely to get
any changes through - ie. changes to mount options were not propogated
to the fstab. Don't know if this is intentional.

Using 3.10 with the provided storage.cf body library.

GREG
--
Greg Matthews 01235 778658
Scientific Computing Group Leader
Diamond Light Source Ltd. OXON UK

--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

Neil H. Watson

unread,
Oct 4, 2017, 1:37:05 PM10/4/17
to help-cfengine
On Wed, Oct 04, 2017 at 05:44:15PM +0100, Gregory Matthews wrote:
>It works quite well but I was surprised by the fact I couldn't pass
>double quotes in the options:
>
>"/mnt" mount => nfs_p("host", "/path",
>"context=\"unconfined_u:object_r:postgresql_db_t:s0\"");

' and " are interchangeable, in pairs, in CFEngine. Thus:

'context="unconfined_u:object_r:postgresql_db_t:s0"');

--
Neil H Watson @neil_h_watson
CFEngine reporting: https://github.com/neilhwatson/delta_reporting
CFEngine policy: https://github.com/neilhwatson/evolve_cfengine_freelib
CFEngine and vim: https://github.com/neilhwatson/vim_cf3
Reply all
Reply to author
Forward
0 new messages