Use Ubuntu in Molecule Test;Fix deprecation warnings

This commit is contained in:
Werner Dijkerman
2018-05-19 21:14:11 +02:00
parent 19a4a44b58
commit 619b52b98a
6 changed files with 24 additions and 12 deletions

View File

@ -3,7 +3,7 @@
hosts: localhost
connection: local
gather_facts: False
# no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
vars:
molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
molecule_ephemeral_directory: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}"

View File

@ -13,8 +13,13 @@ platforms:
image: milcom/centos7-systemd
privileged: True
- name: telegraf-debian
image: maint/debian-systemd
image: minimum2scp/systemd-stretch
privileged: True
command: /sbin/init
- name: telegraf-ubuntu
image: solita/ubuntu-systemd:bionic
privileged: True
command: /sbin/init
provisioner:
name: ansible

View File

@ -4,12 +4,19 @@
- name: "Installing which on CentOS"
yum:
name: which
state: installed
when: ansible_distribution == 'CentOS'
state: present
when:
- ansible_os_family == 'RedHat'
- name: "Installing wget on Debian"
apt:
name: wget
state: installed
when: ansible_distribution == 'Debian'
name: "{{ item }}"
state: present
when:
- ansible_os_family == 'Debian'
with_items:
- wget
- gpg
roles:
- role: ansible-telegraf

View File

@ -37,6 +37,6 @@
- name: "Install telegraf package | Debian"
apt:
name: "telegraf"
state: installed
state: present
notify: "Restart Telegraf"
become: yes

View File

@ -21,7 +21,7 @@
group: telegraf
mode: 0640
become: yes
when: telegraf_agent_version|version_compare('0.10.0', '<')
when: telegraf_agent_version is version_compare('0.10.0', '<')
notify: "Restart Telegraf"
- name: "Copy the template for versions >= 0.10.0"
@ -32,7 +32,7 @@
group: telegraf
mode: 0640
become: yes
when: telegraf_agent_version|version_compare('0.10.0', '>=')
when: telegraf_agent_version is version_compare('0.10.0', '>=')
notify: "Restart Telegraf"
- name: "Copy telegraf extra plugins"

View File

@ -21,13 +21,13 @@
round_interval = {{ telegraf_agent_round_interval | lower }}
flush_interval = "{{ telegraf_agent_flush_interval }}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"
metric_batch_size = {{ telegraf_agent_metric_batch_size }}
metric_buffer_limit = {{ telegraf_agent_metric_buffer_limit }}
quiet = {{ telegraf_agent_quiet | lower }}
{% endif %}
{% if telegraf_agent_version|version_compare('1.1', '>=') %}
{% if telegraf_agent_version is version_compare('1.1', '>=') %}
logfile = "{{ telegraf_agent_logfile }}"
omit_hostname = {{ telegraf_agent_omit_hostname | lower }}
{% endif %}