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:
parent
6ac3cbac98
commit
857ba8c899
@ -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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -12,7 +12,7 @@
|
||||
src: "{{ item }}"
|
||||
dest: /etc/ssl/nginx
|
||||
decrypt: yes
|
||||
with_items:
|
||||
loop:
|
||||
- "{{ nginx_license.certificate }}"
|
||||
- "{{ nginx_license.key }}"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user