Skip to content

Commit

Permalink
First updates for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrzybek committed Dec 1, 2017
1 parent 5649e5b commit c71f3a5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/inventory
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
localhost

[all]
localhost ansible_connection=local ansible_become=True
50 changes: 49 additions & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
---

- hosts: localhost
remote_user: root
pre_tasks:
- name: Ensure influxdb output is available
wait_for: host={{ item | urlsplit('hostname') }} port={{ item | urlsplit('port') }}
with_items: "{{ telegraf_output_influxdb_targets }}"
when:
- telegraf_output == 'influxdb'
- telegraf_output_influxdb_http_proxy == 'None'
- name: Ensure HTTP proxy is available (influxdb + http proxy)
wait_for: host={{ telegraf_output_influxdb_http_proxy | urlsplit('hostname') }} port={{ telegraf_output_influxdb_http_proxy | urlsplit('port') }}
when:
- telegraf_output == 'influxdb'
- telegraf_output_influxdb_http_proxy != 'None'
- name: Ensure amqp output is available
wait_for: host={{ telegraf_output_amqp_server }} port=5672
when: telegraf_output == 'amqp'
roles:
- metrics
- openstack-ansible-telegraf
vars:
telegraf_output: amqp
telegraf_output_amqp_user:
telegraf_output_amqp_password:
telegraf_output_amqp_server:
telegraf_output_amqp_vhost:
telegraf_output_amqp_url: "amqp://{{ telegraf_output_amqp_user }}:{{ telegraf_output_amqp_password }}@{{ telegraf_output_amqp_server }}:5672/{{ telegraf_output_amqp_vhost }}"

- hosts: localhost
remote_user: root
pre_tasks:
- name: Ensure influxdb output is available
wait_for: host={{ item | urlsplit('hostname') }} port={{ item | urlsplit('port') }}
with_items: "{{ telegraf_output_influxdb_targets }}"
when:
- telegraf_output == 'influxdb'
- telegraf_output_influxdb_http_proxy == 'None'
- name: Ensure HTTP proxy is available (influxdb + http proxy)
wait_for: host={{ telegraf_output_influxdb_http_proxy | urlsplit('hostname') }} port={{ telegraf_output_influxdb_http_proxy | urlsplit('port') }}
when:
- telegraf_output == 'influxdb'
- telegraf_output_influxdb_http_proxy != 'None'
- name: Ensure amqp output is available
wait_for: host={{ telegraf_output_amqp_server }} port=5672
when: telegraf_output == 'amqp'
roles:
- openstack-ansible-telegraf
vars:
telegraf_output: influxdb
telegraf_output_influxdb_targets: []
telegraf_openstack_scripts_data_format: influx

0 comments on commit c71f3a5

Please sign in to comment.