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
|
path: /etc/nginx/nginx.conf
|
||||||
insertbefore: BOF
|
insertbefore: BOF
|
||||||
line: "{{ item }}"
|
line: "{{ item }}"
|
||||||
with_items:
|
loop:
|
||||||
- load_module modules/ngx_http_geoip_module.so;
|
- load_module modules/ngx_http_geoip_module.so;
|
||||||
- load_module modules/ngx_stream_geoip_module.so;
|
- load_module modules/ngx_stream_geoip_module.so;
|
||||||
when: not nginx_main_template_enable
|
when: not nginx_main_template_enable
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
path: /etc/nginx/nginx.conf
|
path: /etc/nginx/nginx.conf
|
||||||
insertbefore: BOF
|
insertbefore: BOF
|
||||||
line: "{{ item }}"
|
line: "{{ item }}"
|
||||||
with_items:
|
loop:
|
||||||
- load_module modules/ngx_http_js_module.so;
|
- load_module modules/ngx_http_js_module.so;
|
||||||
- load_module modules/ngx_stream_js_module.so;
|
- load_module modules/ngx_stream_js_module.so;
|
||||||
when: not nginx_main_template_enable
|
when: not nginx_main_template_enable
|
||||||
|
@ -16,8 +16,7 @@
|
|||||||
- name: "(Install: Debian/Ubuntu) Add NGINX Repository"
|
- name: "(Install: Debian/Ubuntu) Add NGINX Repository"
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "{{ item }}"
|
repo: "{{ item }}"
|
||||||
with_items:
|
loop: "{{ repository }}"
|
||||||
- "{{ repository }}"
|
|
||||||
|
|
||||||
- name: "(Install: Debian/Ubuntu) Install NGINX"
|
- name: "(Install: Debian/Ubuntu) Install NGINX"
|
||||||
apt:
|
apt:
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: /etc/ssl/nginx
|
dest: /etc/ssl/nginx
|
||||||
decrypt: yes
|
decrypt: yes
|
||||||
with_items:
|
loop:
|
||||||
- "{{ nginx_license.certificate }}"
|
- "{{ nginx_license.certificate }}"
|
||||||
- "{{ nginx_license.key }}"
|
- "{{ nginx_license.key }}"
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ nginx_unit_modules }}"
|
loop: "{{ nginx_unit_modules }}"
|
||||||
when: ansible_os_family != "FreeBSD"
|
when: ansible_os_family != "FreeBSD"
|
||||||
notify: "(Handler: Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit"
|
notify: "(Handler: Debian/Ubuntu/CentOS/RedHat) Start NGINX Unit"
|
||||||
|
|
||||||
@ -11,6 +11,6 @@
|
|||||||
portinstall:
|
portinstall:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ nginx_unit_modules }}"
|
loop: "{{ nginx_unit_modules }}"
|
||||||
when: ansible_os_family == "FreeBSD"
|
when: ansible_os_family == "FreeBSD"
|
||||||
notify: "(Handler: FreeBSD) Start NGINX Unit"
|
notify: "(Handler: FreeBSD) Start NGINX Unit"
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
- name: "(Install: Debian/Ubuntu) Add NGINX Unit Repository"
|
- name: "(Install: Debian/Ubuntu) Add NGINX Unit Repository"
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "{{ item }}"
|
repo: "{{ item }}"
|
||||||
with_items:
|
loop:
|
||||||
- deb [arch=amd64] https://packages.nginx.org/unit/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} unit
|
- 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
|
- deb-src https://packages.nginx.org/unit/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release }} unit
|
||||||
|
Loading…
Reference in New Issue
Block a user