Fix deprecations (#35)

* Drop Nagios support
* Fix start PHP-FPM on Docker
* 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 M
2019-01-24 11:05:46 +01:00
committed by GitHub
parent 87c1c68949
commit 8218e5c972
25 changed files with 71 additions and 191 deletions

View File

@@ -2,17 +2,12 @@
- name: APT | Install webapps
apt:
pkg: "{{ item }}"
pkg: "{{ packages }}"
state: present
install_recommends: no
with_items:
- backuppc
- name: APT | Install nagios3 (only on old Debian releases)
apt:
pkg: nagios3
state: present
when: ansible_distribution_major_version | version_compare('9', 'lt')
vars:
packages:
- backuppc
- name: SERVICE | Ensure backuppc is started
service:

View File

@@ -5,7 +5,6 @@
# pkg: "{{ item }}"
# state: present
# with_items:
# - nagios
# - backuppc
#
#- name: COMMAND | Activate backuppc config
@@ -19,13 +18,6 @@
# owner: backuppc
# group: backuppc
#
#- name: FILE | Fix fcgiwrap permission
# file:
# path: "{{ nginx_fcgiwrap_sock }}"
# mode: 0640
# owner: "{{ nginx_user }}"
# group: "{{ nginx_user }}"
#
# We don't manage BackupPC on FreeBSD... too dirty. :/
#

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,11 +78,13 @@
name: "fcgiwrap"
state: started
# Bypasses Ansible 2.4 issue (cannot use service module)... With service module... php is not really started!
# Bypasses Ansible+Docker issue. 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 }}"
when: apt_php.changed
args:
creates: "{{ item.version | php_default_upstream_socket }}"
warn: false
loop: "{{ nginx_php }}"
- name: GET_URL | Download ngrok
get_url:

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