Skip to content

Instantly share code, notes, and snippets.

@jbgo
Created June 4, 2016 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbgo/2a04cae6626116858d5bc660fbeaec1c to your computer and use it in GitHub Desktop.
Save jbgo/2a04cae6626116858d5bc660fbeaec1c to your computer and use it in GitHub Desktop.
Iteration 2 Playbook - Stupid DevOps Tricks: Executable IT docs with Ansible
---
- name: Install a new client (https://confluence.example.com/foo/bar/biz-baz)
hosts: app.example.com
gather_facts: false
tasks:
- name: Verify that the NFS images share is mounted
shell: "df -h | grep nfs.example.com:/srv/images"
register: nfs_check
changed_when: false
failed_when: false
- name: Mount the NFS images share if it's not currently mounted
shell: "mount nfs.example.com:/srv/images /images"
register: nfs_mount
when: "{{nfs_check.rc != 0}}"
changed_when: "{{nfs_check.rc != 0}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment