Replace action by modules

This commit is contained in:
Thomas Szymanski
2017-02-22 10:50:06 +01:00
parent ae8c1cbe7f
commit c416bb20a7
4 changed files with 26 additions and 26 deletions

View File

@ -2,8 +2,8 @@
# handlers file for ansible-telegraf
- name: "Restart Telegraf"
action: service
name=telegraf
state=restarted
enabled=yes
service:
name: telegraf
state: restarted
enabled: yes
become: yes

View File

@ -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

View File

@ -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:

View File

@ -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"