Fix deprecations on Ansible 2.7

- with_ -> loop
- fix filters as test
- test version_compare -> version
- set min_version to 2.5
This commit is contained in:
Emilien Mantel
2019-01-22 22:08:14 +01:00
parent d168219c29
commit 682339d818
17 changed files with 63 additions and 77 deletions

View File

@@ -2,11 +2,12 @@
- name: APT | Install webapps
apt:
pkg: "{{ item }}"
pkg: "{{ packages }}"
state: present
install_recommends: no
with_items:
- backuppc
vars:
packages:
- backuppc
- name: SERVICE | Ensure backuppc is started
service:

View File

@@ -45,19 +45,20 @@
- name: APT | Install needed packages
apt:
pkg: "{{ item }}"
pkg: "{{ packages }}"
update_cache: yes
cache_valid_time: 3600
state: present
with_items:
- cron
- curl
- fcgiwrap
- jq
- nghttp2
- strace
- vim
- unzip
vars:
packages:
- cron
- curl
- fcgiwrap
- jq
- nghttp2
- strace
- vim
- unzip
- name: APT | Install daemonize from Stretch
apt:
@@ -69,7 +70,7 @@
update_cache: yes
cache_valid_time: 3600
state: present
with_items: "{{ nginx_php }}"
loop: "{{ nginx_php }}"
register: apt_php
- name: SERVICE | Force start fcgiwrap
@@ -77,10 +78,11 @@
name: "fcgiwrap"
state: started
# Bypasses Ansible 2.4 issue (cannot use service module)... With service module... php is not really started!
- name: COMMAND | Force start PHP
command: "service {{ item.version | php_fpm_service }} start"
with_items: "{{ nginx_php }}"
service:
name: "{{ item.version | php_fpm_service }}"
state: started
loop: "{{ nginx_php }}"
when: apt_php.changed
- name: GET_URL | Download ngrok

View File

@@ -15,17 +15,18 @@
- name: PKGNG | Install needed packages
pkgng:
pkg: "{{ item }}"
pkg: "{{ packages }}"
state: present
with_items:
- curl
- daemonize
- fcgiwrap
- GeoIP
- jq
- nghttp2
- php72
- vim
vars:
packages:
- curl
- daemonize
- fcgiwrap
- GeoIP
- jq
- nghttp2
- php72
- vim
- name: COMMAND | Get geoip database
command: geoipupdate.sh
@@ -38,7 +39,7 @@
state: started
enabled: yes
register: sf
with_items:
loop:
- php-fpm
- fcgiwrap

View File

@@ -14,6 +14,8 @@
- name: SHELL | Get ngrok public address
shell: curl 'http://127.0.0.1:4040/api/tunnels/command_line' | jq '.public_url' | grep -oE '[[:alnum:]]+\.ngrok\.io'
args:
warn: false
register: ngrok
changed_when: false
@@ -22,6 +24,6 @@
line: "set mouse="
dest: "{{ item }}/.vimrc"
create: yes
with_items:
loop:
- /root
- /home/vagrant