mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Use Ubuntu in Molecule Test;Fix deprecation warnings
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
hosts: localhost
|
hosts: localhost
|
||||||
connection: local
|
connection: local
|
||||||
gather_facts: False
|
gather_facts: False
|
||||||
# no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
|
no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
|
||||||
vars:
|
vars:
|
||||||
molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
|
molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
|
||||||
molecule_ephemeral_directory: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}"
|
molecule_ephemeral_directory: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}"
|
||||||
|
@ -13,8 +13,13 @@ platforms:
|
|||||||
image: milcom/centos7-systemd
|
image: milcom/centos7-systemd
|
||||||
privileged: True
|
privileged: True
|
||||||
- name: telegraf-debian
|
- name: telegraf-debian
|
||||||
image: maint/debian-systemd
|
image: minimum2scp/systemd-stretch
|
||||||
privileged: True
|
privileged: True
|
||||||
|
command: /sbin/init
|
||||||
|
- name: telegraf-ubuntu
|
||||||
|
image: solita/ubuntu-systemd:bionic
|
||||||
|
privileged: True
|
||||||
|
command: /sbin/init
|
||||||
|
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
@ -4,12 +4,19 @@
|
|||||||
- name: "Installing which on CentOS"
|
- name: "Installing which on CentOS"
|
||||||
yum:
|
yum:
|
||||||
name: which
|
name: which
|
||||||
state: installed
|
state: present
|
||||||
when: ansible_distribution == 'CentOS'
|
when:
|
||||||
|
- ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
- name: "Installing wget on Debian"
|
- name: "Installing wget on Debian"
|
||||||
apt:
|
apt:
|
||||||
name: wget
|
name: "{{ item }}"
|
||||||
state: installed
|
state: present
|
||||||
when: ansible_distribution == 'Debian'
|
when:
|
||||||
|
- ansible_os_family == 'Debian'
|
||||||
|
with_items:
|
||||||
|
- wget
|
||||||
|
- gpg
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: ansible-telegraf
|
- role: ansible-telegraf
|
||||||
|
@ -37,6 +37,6 @@
|
|||||||
- name: "Install telegraf package | Debian"
|
- name: "Install telegraf package | Debian"
|
||||||
apt:
|
apt:
|
||||||
name: "telegraf"
|
name: "telegraf"
|
||||||
state: installed
|
state: present
|
||||||
notify: "Restart Telegraf"
|
notify: "Restart Telegraf"
|
||||||
become: yes
|
become: yes
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
group: telegraf
|
group: telegraf
|
||||||
mode: 0640
|
mode: 0640
|
||||||
become: yes
|
become: yes
|
||||||
when: telegraf_agent_version|version_compare('0.10.0', '<')
|
when: telegraf_agent_version is version_compare('0.10.0', '<')
|
||||||
notify: "Restart Telegraf"
|
notify: "Restart Telegraf"
|
||||||
|
|
||||||
- name: "Copy the template for versions >= 0.10.0"
|
- name: "Copy the template for versions >= 0.10.0"
|
||||||
@ -32,7 +32,7 @@
|
|||||||
group: telegraf
|
group: telegraf
|
||||||
mode: 0640
|
mode: 0640
|
||||||
become: yes
|
become: yes
|
||||||
when: telegraf_agent_version|version_compare('0.10.0', '>=')
|
when: telegraf_agent_version is version_compare('0.10.0', '>=')
|
||||||
notify: "Restart Telegraf"
|
notify: "Restart Telegraf"
|
||||||
|
|
||||||
- name: "Copy telegraf extra plugins"
|
- name: "Copy telegraf extra plugins"
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
round_interval = {{ telegraf_agent_round_interval | lower }}
|
round_interval = {{ telegraf_agent_round_interval | lower }}
|
||||||
flush_interval = "{{ telegraf_agent_flush_interval }}s"
|
flush_interval = "{{ telegraf_agent_flush_interval }}s"
|
||||||
flush_jitter = "{{ telegraf_agent_flush_jitter }}s"
|
flush_jitter = "{{ telegraf_agent_flush_jitter }}s"
|
||||||
{% if telegraf_agent_version|version_compare('0.13', '>=') %}
|
{% if telegraf_agent_version is version_compare('0.13', '>=') %}
|
||||||
collection_jitter = "{{ telegraf_agent_collection_jitter }}s"
|
collection_jitter = "{{ telegraf_agent_collection_jitter }}s"
|
||||||
metric_batch_size = {{ telegraf_agent_metric_batch_size }}
|
metric_batch_size = {{ telegraf_agent_metric_batch_size }}
|
||||||
metric_buffer_limit = {{ telegraf_agent_metric_buffer_limit }}
|
metric_buffer_limit = {{ telegraf_agent_metric_buffer_limit }}
|
||||||
quiet = {{ telegraf_agent_quiet | lower }}
|
quiet = {{ telegraf_agent_quiet | lower }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if telegraf_agent_version|version_compare('1.1', '>=') %}
|
{% if telegraf_agent_version is version_compare('1.1', '>=') %}
|
||||||
logfile = "{{ telegraf_agent_logfile }}"
|
logfile = "{{ telegraf_agent_logfile }}"
|
||||||
omit_hostname = {{ telegraf_agent_omit_hostname | lower }}
|
omit_hostname = {{ telegraf_agent_omit_hostname | lower }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user