[WIP] split pre/post tasks related to OS version

pull/14/head
Emilien Mantel 2016-03-05 15:46:54 +01:00
parent 791832f6d1
commit 8edd69547d
5 changed files with 39 additions and 32 deletions

View File

@ -0,0 +1,10 @@
---
- name: APT | Install web apps
apt: pkg={{ item }} state=present
with_items:
- nagios3
- backuppc
- name: SERVICE | Ensure backuppc is started
service: name=backuppc state=started

View File

@ -0,0 +1,2 @@
---

View File

@ -0,0 +1,18 @@
---
- name: APT_REPOSITORY | Install backports
apt_repository: repo='deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main' state=present
- name: APT | Install needed packages
apt: pkg={{ item }} update_cache=yes cache_valid_time=3600 state=present
with_items:
- php5-fpm
- curl
- fcgiwrap
- name: SERVICE | Force start services
service: name={{ item }} state=started
register: sf
with_items:
- php5-fpm
- fcgiwrap

View File

@ -0,0 +1,5 @@
---
- name: SET_FACT | FreeBSD web user
set_fact:
nginx_user: 'www'

View File

@ -2,30 +2,8 @@
- hosts: all
pre_tasks:
- block:
- name: APT_REPOSITORY | Install backports
apt_repository: repo='deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main' state=present
- name: APT | Install needed packages
apt: pkg={{ item }} update_cache=yes cache_valid_time=3600 state=present
with_items:
- php5-fpm
- curl
- fcgiwrap
- name: SERVICE | Force start services
service: name={{ item }} state=started
register: sf
with_items:
- php5-fpm
- fcgiwrap
when: ansible_distribution == 'Debian'
- block:
- name: SET_FACT | FreeBSD web user
set_fact:
nginx_user: 'www'
when: ansible_distribution == 'FreeBSD'
- name: PAUSE | Prevent bugs (CGI not fully loaded)
pause: seconds=5
when: sf.changed
- name: INCLUDE | Pre_tasks related to OS version
include: "includes/pre_{{ ansible_distribution }}.yml"
- name: FILE | Create an internal SSL dir
file: path={{ int_ansible_ssl_dir }} state=directory
- name: COPY | Deploy test certificate
@ -199,14 +177,8 @@
# --------------------------------
# Apps
# --------------------------------
- name: APT | Install web apps
apt: pkg={{ item }} state=present
with_items:
- nagios3
- backuppc
- name: SERVICE | Ensure backuppc is started
service: name=backuppc state=started
- name: INCLUDE | Post_tasks related to OS version
include: "includes/post_{{ ansible_distribution }}.yml"
# --------------------------------
# Deploy index files
# --------------------------------