mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Replace action by modules
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
# handlers file for ansible-telegraf
|
||||
|
||||
- name: "Restart Telegraf"
|
||||
action: service
|
||||
name=telegraf
|
||||
state=restarted
|
||||
enabled=yes
|
||||
become: yes
|
||||
service:
|
||||
name: telegraf
|
||||
state: restarted
|
||||
enabled: yes
|
||||
become: yes
|
||||
|
12
playbook.yml
12
playbook.yml
@ -2,14 +2,14 @@
|
||||
- hosts: all
|
||||
pre_tasks:
|
||||
- name: "Installing which on CentOS"
|
||||
action: yum
|
||||
name=which
|
||||
state=installed
|
||||
yum:
|
||||
name: which
|
||||
state: installed
|
||||
when: ansible_distribution == 'CentOS'
|
||||
- name: "Installing wget on Debian"
|
||||
action: apt
|
||||
name=wget
|
||||
state=installed
|
||||
apt:
|
||||
name: wget
|
||||
state: installed
|
||||
when: ansible_distribution == 'Debian'
|
||||
roles:
|
||||
- role: ansible-telegraf
|
||||
|
@ -50,9 +50,9 @@
|
||||
when: ansible_lsb is not defined
|
||||
|
||||
- name: "Install telegraf package | Debian"
|
||||
action: apt
|
||||
name=telegraf
|
||||
state=installed
|
||||
apt:
|
||||
name: telegraf
|
||||
state: installed
|
||||
notify: "Restart Telegraf"
|
||||
become: yes
|
||||
tags:
|
||||
|
@ -1,14 +1,14 @@
|
||||
---
|
||||
|
||||
- name: "Enable EPEL"
|
||||
action: yum
|
||||
name=epel-release
|
||||
state=installed
|
||||
yum:
|
||||
name: epel-release
|
||||
state: installed
|
||||
|
||||
- name: "Installing some dependencies"
|
||||
action: yum
|
||||
name={{ item }}
|
||||
state=installed
|
||||
yum:
|
||||
name: "{{ item }}"
|
||||
state: installed
|
||||
with_items:
|
||||
- python-pip
|
||||
- python-devel
|
||||
@ -17,9 +17,9 @@
|
||||
- openssl-devel
|
||||
|
||||
- name: "Installing PIP dependensies"
|
||||
action: pip
|
||||
name={{ item }}
|
||||
state=present
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- urllib3
|
||||
- pyopenssl
|
||||
@ -34,7 +34,7 @@
|
||||
gpgkey: https://repos.influxdata.com/influxdb.key
|
||||
|
||||
- name: "Install telegraf package | RedHat"
|
||||
action: yum
|
||||
name="telegraf-{{ telegraf_agent_version }}"
|
||||
state=installed
|
||||
yum:
|
||||
name: "telegraf-{{ telegraf_agent_version }}"
|
||||
state: installed
|
||||
notify: "Restart Telegraf"
|
||||
|
Reference in New Issue
Block a user