Skip to content

Instantly share code, notes, and snippets.

@jbergstroem
Created October 3, 2016 20:03
Show Gist options
  • Select an option

  • Save jbergstroem/80666c5e367a0a40373fd5d88419c95f to your computer and use it in GitHub Desktop.

Select an option

Save jbergstroem/80666c5e367a0a40373fd5d88419c95f to your computer and use it in GitHub Desktop.
- name: install monit
package: name=monit state=present
- name: add monit config
copy:
args:
src: "{{ monitrc }}"
dest: "/etc/monitrc"
mode: 0600
loop_control:
loop_var: monitrc
with_first_found:
- files:
- "{{ role_path }}/files/{{ os }}.monitrc"
- "{{ role_path }}/files/{{ os|stripversion }}.monitrc"
TASK [jenkins-worker : enable jenkins at startup] ******************************
ok: [test-joyent-smartos15-x64-1]
TASK [jenkins-worker : install monit] ******************************************
skipping: [test-joyent-smartos15-x64-1]
TASK [jenkins-worker : add monit config] ***************************************
[WARNING]: Unable to find '/Users/jbergstroem/Work/node/build/ansible/roles/jenkins-worker/files/smartos15.monitrc' in expected paths.
[WARNING]: Unable to find '/Users/jbergstroem/Work/node/build/ansible/roles/jenkins-worker/files/smartos.monitrc' in expected paths.
fatal: [test-joyent-smartos15-x64-1]: FAILED! => {"failed": true, "msg": "No file was found when using with_first_found. Use the 'skip: true' option to allow this task to be skipped if no files are found"}
PLAY RECAP *********************************************************************
test-joyent-smartos15-x64-1 : ok=17 changed=2 unreachable=0 failed=1
- name: install monit
when: os in needs_monit
include: monit.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment