switch to new loop syntax
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2019-02-03 23:26:35 +01:00
parent 91eafefb9c
commit 627b461aac
5 changed files with 8 additions and 24 deletions

View File

@ -52,8 +52,6 @@ unifi_tls_certs_dir: "{{ unifi_base_dir }}/tls/certs"
unifi_tls_key_dir: "{{ unifi_base_dir }}/tls/private"
unifi_tls_cert_file: "{{ unifi_tls_certs_dir }}/mycert.pem"
unifi_tls_key_file: "{{ unifi_tls_key_dir }}/mykey.pem"
unifi_tls_source_use_content: False
unifi_tls_source_use_files: True
unifi_tls_cert_source: mycert.pem
unifi_tls_key_source: mykey.pem

View File

@ -6,7 +6,7 @@
owner: "{{ unifi_user }}"
group: "{{ unifi_group }}"
recurse: True
with_items:
loop:
- "{{ unifi_base_dir }}"
- "{{ unifi_base_dir }}/{{ unifi_version }}"
- "{{ unifi_tmp_dir }}"
@ -86,7 +86,7 @@
state: "{{ item.state }}"
weight: "{{ item.weight|default(omit) }}"
table: "{{ item.table|default(omit) }}"
with_items: "{{ unifi_open_ports }}"
loop: "{{ unifi_open_ports }}"
loop_control:
label: "{{ item.name }}"
when: unifi_iptables_enabled

View File

@ -1,30 +1,16 @@
---
- block:
- name: Copy certs and private key to nginx proxy (content)
copy:
content: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- { src: "{{ unifi_tls_key_source }}", dest: '/etc/pki/tls/private/{{ unifi_nginx_tls_key_file }}', mode: '0600' }
- { src: "{{ unifi_tls_cert_source }}", dest: '/etc/pki/tls/certs/{{ unifi_nginx_tls_cert_file }}', mode: '0750' }
loop_control:
label: "{{ item.dest }}"
notify: __nginx_reload
when: unifi_tls_source_use_content
- name: Copy certs and private key to nginx proxy (files)
- name: Copy certs and private key to nginx proxy
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
loop:
- { src: "{{ unifi_tls_key_source }}", dest: '/etc/pki/tls/private/{{ unifi_nginx_tls_key_file }}', mode: '0600' }
- { src: "{{ unifi_tls_cert_source }}", dest: '/etc/pki/tls/certs/{{ unifi_nginx_tls_cert_file }}', mode: '0750' }
loop_control:
label: "{{ item.dest }}"
notify: __nginx_reload
when: unifi_tls_source_use_files
delegate_to: "{{ unifi_nginx_server }}"
when: unifi_nginx_tls_enabled
become: True

View File

@ -11,7 +11,7 @@
package:
name: "{{ item }}"
state: present
with_items:
loop:
- "java-{{ unifi_openjdk_version }}-openjdk"
- unzip
- wget

View File

@ -7,7 +7,7 @@
owner: "{{ unifi_user }}"
group: "{{ unifi_group }}"
recurse: True
with_items:
loop:
- "{{ unifi_tls_certs_dir }}"
- "{{ unifi_tls_key_dir }}"
become: True
@ -19,7 +19,7 @@
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
loop:
- { src: "{{ unifi_tls_key_source }}", dest: '{{ unifi_tls_key_file }}', mode: '0600' }
- { src: "{{ unifi_tls_cert_source }}", dest: '{{ unifi_tls_cert_file }}', mode: '0750' }
loop_control:
@ -32,7 +32,7 @@
content: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
loop:
- { src: "{{ unifi_tls_key_source }}", dest: '{{ unifi_tls_key_file }}', mode: '0600' }
- { src: "{{ unifi_tls_cert_source }}", dest: '{{ unifi_tls_cert_file }}', mode: '0750' }
loop_control: