Replace with_items with loop (#282)

`loop` is now the recommended way to loop through lists instead of `with_items`
This commit is contained in:
Alessandro Fael Garcia 2020-07-08 14:55:15 +02:00 committed by GitHub
parent 6ac3cbac98
commit 857ba8c899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 8 deletions

View File

@ -22,7 +22,7 @@
path: /etc/nginx/nginx.conf
insertbefore: BOF
line: "{{ item }}"
with_items:
loop:
- load_module modules/ngx_http_geoip_module.so;
- load_module modules/ngx_stream_geoip_module.so;
when: not nginx_main_template_enable

View File

@ -16,7 +16,7 @@
path: /etc/nginx/nginx.conf
insertbefore: BOF
line: "{{ item }}"
with_items:
loop:
- load_module modules/ngx_http_js_module.so;
- load_module modules/ngx_stream_js_module.so;
when: not nginx_main_template_enable

View File

@ -16,8 +16,7 @@
- name: "(Install: Debian/Ubuntu) Add NGINX Repository"
apt_repository:
repo: "{{ item }}"
with_items:
- "{{ repository }}"
loop: "{{ repository }}"
- name: "(Install: Debian/Ubuntu) Install NGINX"
apt:

View File

@ -12,7 +12,7 @@
src: "{{ item }}"
dest: /etc/ssl/nginx
decrypt: yes
with_items:
loop:
- "{{ nginx_license.certificate }}"
- "{{ nginx_license.key }}"

View File

@ -3,7 +3,7 @@
package:
name: "{{ item }}"
state: present
with_items: "{{ nginx_unit_modules }}"
loop: "{{ nginx_unit_modules }}"
when: ansible_os_family != "FreeBSD"
notify: "(Handler: Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit"
@ -11,6 +11,6 @@
portinstall:
name: "{{ item }}"
state: present
with_items: "{{ nginx_unit_modules }}"
loop: "{{ nginx_unit_modules }}"
when: ansible_os_family == "FreeBSD"
notify: "(Handler: FreeBSD) Start NGINX Unit"

View File

@ -2,6 +2,6 @@
- name: "(Install: Debian/Ubuntu) Add NGINX Unit Repository"
apt_repository:
repo: "{{ item }}"
with_items:
loop:
- deb [arch=amd64] https://packages.nginx.org/unit/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} unit
- deb-src https://packages.nginx.org/unit/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} unit