After sorting out yesterday's problem and how I wanted my /etc/fstab to look, I set about implementing it via Ansible. Ultimately, I ended up settling on a list-of-maps variable to drive a lineinfile role-task. I chose a list-of-maps variable mostly because the YAML that Ansible relies on doesn't really do tuples. My var ended up looking like:
s3fs_fstab_nest: - mountpoint: /provisioning/repo bucket: s3fs-build-bukkit folder: RPMs - mountpoint: /provisioning/installers bucket: s3fs-build-bukkit folder: EXEs - mountpoint: /Data/personal bucket: s3fs-users-bukkit folder: build
And my play ended up looking like:
--- - name: "Add mount to /etc/fstab" lineinfile: path: '/etc/fstab' line: "s3fs#{{ item.bucket }}:/{{ item.folder }}\t{{ item.mountpoint }}fuse\t_netdev,allow_other,umask=0000,nonempty 0 0" loop: "{{ s3fs_fstab_nest }}" ...
Was actually a lot simpler than I was expecting it to be.
No comments:
Post a Comment