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: yum:
name: "{{ item }}" name: "{{ item }}"
state: latest state: latest
with_items: "{{ server_packages }}" loop: "{{ server_packages }}"
become: true become: true

View file

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

View file

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

View file

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

View file

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

View file

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