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 # handlers file for ansible-telegraf
- name: "Restart Telegraf" - name: "Restart Telegraf"
action: service service:
name=telegraf name: telegraf
state=restarted state: restarted
enabled=yes enabled: yes
become: yes become: yes

View File

@ -2,14 +2,14 @@
- hosts: all - hosts: all
pre_tasks: pre_tasks:
- name: "Installing which on CentOS" - name: "Installing which on CentOS"
action: yum yum:
name=which name: which
state=installed state: installed
when: ansible_distribution == 'CentOS' when: ansible_distribution == 'CentOS'
- name: "Installing wget on Debian" - name: "Installing wget on Debian"
action: apt apt:
name=wget name: wget
state=installed state: installed
when: ansible_distribution == 'Debian' when: ansible_distribution == 'Debian'
roles: roles:
- role: ansible-telegraf - role: ansible-telegraf

View File

@ -50,9 +50,9 @@
when: ansible_lsb is not defined when: ansible_lsb is not defined
- name: "Install telegraf package | Debian" - name: "Install telegraf package | Debian"
action: apt apt:
name=telegraf name: telegraf
state=installed state: installed
notify: "Restart Telegraf" notify: "Restart Telegraf"
become: yes become: yes
tags: tags:

View File

@ -1,14 +1,14 @@
--- ---
- name: "Enable EPEL" - name: "Enable EPEL"
action: yum yum:
name=epel-release name: epel-release
state=installed state: installed
- name: "Installing some dependencies" - name: "Installing some dependencies"
action: yum yum:
name={{ item }} name: "{{ item }}"
state=installed state: installed
with_items: with_items:
- python-pip - python-pip
- python-devel - python-devel
@ -17,9 +17,9 @@
- openssl-devel - openssl-devel
- name: "Installing PIP dependensies" - name: "Installing PIP dependensies"
action: pip pip:
name={{ item }} name: "{{ item }}"
state=present state: present
with_items: with_items:
- urllib3 - urllib3
- pyopenssl - pyopenssl
@ -34,7 +34,7 @@
gpgkey: https://repos.influxdata.com/influxdb.key gpgkey: https://repos.influxdata.com/influxdb.key
- name: "Install telegraf package | RedHat" - name: "Install telegraf package | RedHat"
action: yum yum:
name="telegraf-{{ telegraf_agent_version }}" name: "telegraf-{{ telegraf_agent_version }}"
state=installed state: installed
notify: "Restart Telegraf" notify: "Restart Telegraf"