break: change with_items to loop

This commit is contained in:
Adrien Waksberg 2018-12-01 08:00:35 +01:00
parent 3b682bee44
commit 22dd6dd8cd
6 changed files with 11 additions and 9 deletions

View file

@ -3,7 +3,6 @@ sudo: required
language: ruby language: ruby
env: env:
- ANSIBLE_VERSION=2.4
- ANSIBLE_VERSION=2.5 - ANSIBLE_VERSION=2.5
- ANSIBLE_VERSION=2.6 - ANSIBLE_VERSION=2.6
- ANSIBLE_VERSION=2.7 - ANSIBLE_VERSION=2.7

View file

@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
Which is based on [Keep A Changelog](http://keepachangelog.com/) Which is based on [Keep A Changelog](http://keepachangelog.com/)
## [Unreleased] ## [Unreleased]
- BREAKING CHANGE: change with_items to loop
- test: add test with ansible 2.7 - test: add test with ansible 2.7
- test: add ansible-lint - test: add ansible-lint
- test: add yamllint - test: add yamllint

View file

@ -7,7 +7,7 @@ Install and configure PHP FPM
## Requirements ## Requirements
* Ansible >= 2.4 * Ansible >= 2.5
* Debian Stretch * Debian Stretch
## Role variables ## Role variables

View file

@ -5,7 +5,7 @@ galaxy_info:
company: Adrien Waksberg company: Adrien Waksberg
description: Install and configure PHP-FPM description: Install and configure PHP-FPM
license: Apache2 license: Apache2
min_ansible_version: 2.4 min_ansible_version: 2.5
platforms: platforms:
- name: Debian - name: Debian

View file

@ -6,8 +6,7 @@
- name: install additionnal packages - name: install additionnal packages
package: package:
name: '{{ item }}' name: '{{ phpfpm_packages }}'
with_items: '{{ phpfpm_packages }}'
tags: phpfpm tags: phpfpm
- name: create log directory - name: create log directory

View file

@ -2,9 +2,12 @@
- name: check if pools log files exist - name: check if pools log files exist
stat: stat:
path: '{{ phpfpm_dir_log }}/{{ item[0].name }}.{{ item[1] }}' path: '{{ phpfpm_dir_log }}/{{ item[0].name }}.{{ item[1] }}'
with_nested: loop: '{{ phpfpm_pools|product(log_files)|list }}'
- '{{ phpfpm_pools }}' vars:
- ['slow.log', 'access.log', 'log'] log_files:
- slow.log
- access.log
- log
register: st register: st
tags: phpfpm tags: phpfpm
@ -15,7 +18,7 @@
group: www-data group: www-data
mode: 0640 mode: 0640
state: touch state: touch
with_items: '{{ st.results }}' loop: '{{ st.results }}'
when: not item.stat.exists when: not item.stat.exists
tags: phpfpm tags: phpfpm