Skip to content

Instantly share code, notes, and snippets.

@jbgo
Last active June 4, 2016 19:48
Show Gist options
  • Save jbgo/a227e1db2273eee4a359ba79606c3f25 to your computer and use it in GitHub Desktop.
Save jbgo/a227e1db2273eee4a359ba79606c3f25 to your computer and use it in GitHub Desktop.
Iteration 1 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 images NFS share is mounted
shell: "df -h | grep nfs.example.com:/srv/images"
register: nfs_check
ignore_errors: yes
# display the output of the previous command in a readable format
- debug: var=nfs_check.stdout_lines
- pause: |
prompt="
Examine the above output to verify that the /srv/images share is mounted.
Press Enter to continue or Ctrl-C to abort"
- name: Mount the NFS images share if it's not currently mounted
shell: "mount nfs.example.com:/srv/images /images"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment