Convert from 'with_items' to 'loop'

This commit is contained in:
Scott Wallace 2019-01-20 10:51:09 +00:00
parent a691f35494
commit ebba76be0e
6 changed files with 17 additions and 17 deletions

View file

@ -4,5 +4,5 @@
yum:
name: "{{ item }}"
state: latest
with_items: "{{ server_packages }}"
loop: "{{ server_packages }}"
become: true

View file

@ -15,7 +15,7 @@
name: erlang
state: present
become: true
- name: Install RabbitMQ & Redis
tags:
- install
@ -23,10 +23,10 @@
name: "{{ item }}"
state: present
become: true
with_items:
loop:
- http://www.rabbitmq.com/releases/rabbitmq-server/current/rabbitmq-server-3.6.15-1.el7.noarch.rpm
- redis
- name: Install the latest version of Sensu
tags:
- install
@ -34,7 +34,7 @@
name: "{{ item }}"
state: latest
become: true
with_items:
loop:
- sensu
- uchiwa
@ -79,7 +79,7 @@
"bind": "0.0.0.0",
"port": 4567
}
}
}
dest: "{{ sensu_basepath }}/conf.d/api.json"
become: true
@ -132,7 +132,7 @@
name: "{{ item }}"
enabled: true
state: started
with_items:
loop:
- sensu-client
- sensu-server
- sensu-api
@ -152,5 +152,5 @@
notify:
- restart firewalld
become: true
- import_tasks: sensu_checks.yaml

View file

@ -3,7 +3,7 @@
- install
command: "sensu-install -p {{ item }}"
become: true
with_items:
loop:
- cpu-checks
- disk-checks
- memory-checks
@ -48,4 +48,4 @@
subscribers: default
interval: 60
notify: restart sensu-server
become: true
become: true

View file

@ -4,7 +4,7 @@
git:
repo: "{{ item.repo }}"
dest: "{{ item.dest }}"
with_items: "{{ config_repos }}"
loop: "{{ config_repos }}"
- name: Conky configuration
tags:

View file

@ -4,7 +4,7 @@
apt_repository:
repo: "{{ item }}"
state: present
with_items: "{{ linux_repos }}"
loop: "{{ linux_repos }}"
become: true
- name: Installing packages
@ -13,7 +13,7 @@
package:
name: "{{ item }}"
state: present
with_items: "{{ linux_packages }}"
loop: "{{ linux_packages }}"
become: true
- name: Installing Snaps
@ -23,7 +23,7 @@
# name: "{{ item }}"
# state: present
command: "snap install {{ item }}"
with_items: "{{ linux_apps }}"
loop: "{{ linux_apps }}"
become: true
- name: Checking for Modern Pictogram font

View file

@ -22,7 +22,7 @@
homebrew_tap:
name: "{{ item }}"
state: present
with_items: "{{ homebrew_tap_items }}"
loop: "{{ homebrew_tap_items }}"
# Update and upgrades
- name: Homebrew update and upgrades
@ -39,7 +39,7 @@
homebrew:
name: "{{ item }}"
state: present
with_items: "{{ homebrew_brew_items }}"
loop: "{{ homebrew_brew_items }}"
# Casks
- name: Install Homebrew Casks
@ -48,4 +48,4 @@
homebrew_cask:
name: "{{ item }}"
state: present
with_items: "{{ homebrew_cask_items }}"
loop: "{{ homebrew_cask_items }}"