Skip to content

Instantly share code, notes, and snippets.

@jdiez17
Last active March 3, 2016 11:02
Show Gist options
  • Save jdiez17/807dad36cc9a2cc3efcc to your computer and use it in GitHub Desktop.
Save jdiez17/807dad36cc9a2cc3efcc to your computer and use it in GitHub Desktop.
jdiez@Hobgoblin:~/dev/ops/infrastructure/ansible$ ansible-playbook -i inventory/all bootstrap.yml --limit kylink-dev
PLAY [Install basic services] **************************************************
TASK [setup] *******************************************************************
ok: [kylink-dev]
TASK [common : Install services] ***********************************************
ok: [kylink-dev] => (item=elasticsearch)
ok: [kylink-dev] => (item=logstash)
ok: [kylink-dev] => (item=kibana)
ok: [kylink-dev] => (item=mongo)
ok: [kylink-dev] => (item=postgres)
TASK [common : Reload services] ************************************************
fatal: [kylink-dev]: FAILED! => {"failed": true, "msg": "The conditional check '{{ item }}.changed' failed. The error was: error while evaluating conditional ({{ item }}.changed): 'elasticsearch' is undefined\n\nThe error appears to have been in '/home/jdiez/dev/ops/infrastructure/ansible/roles/common/tasks/main.yaml': line 36, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Reload services\n ^ here\n"}
NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @bootstrap.retry
PLAY RECAP *********************************************************************
kylink-dev : ok=3 changed=0 unreachable=0 failed=1
- name: reload systemd
command: systemctl daemon-reload
- name: Install services
copy: src={{ item }}.service dest=/etc/systemd/system
notify: reload systemd
register: "{{ item }}"
with_items:
- elasticsearch
- logstash
- kibana
- mongo
- postgres
- name: Reload systemd if needed
meta: flush_handlers
- name: Reload services
service: name={{ item }} state=restarted
when: "{{ item }}.changed"
with_items:
- elasticsearch
- logstash
- kibana
- mongo
- postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment