mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-03-30 11:52:09 +07:00
[WIP] split pre/post tasks related to OS version
This commit is contained in:
10
tests/includes/post_Debian.yml
Normal file
10
tests/includes/post_Debian.yml
Normal 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
|
||||||
2
tests/includes/post_FreeBSD.yml
Normal file
2
tests/includes/post_FreeBSD.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
|
||||||
18
tests/includes/pre_Debian.yml
Normal file
18
tests/includes/pre_Debian.yml
Normal 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
|
||||||
5
tests/includes/pre_FreeBSD.yml
Normal file
5
tests/includes/pre_FreeBSD.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: SET_FACT | FreeBSD web user
|
||||||
|
set_fact:
|
||||||
|
nginx_user: 'www'
|
||||||
@@ -2,30 +2,8 @@
|
|||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- block:
|
- name: INCLUDE | Pre_tasks related to OS version
|
||||||
- name: APT_REPOSITORY | Install backports
|
include: "includes/pre_{{ ansible_distribution }}.yml"
|
||||||
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: FILE | Create an internal SSL dir
|
- name: FILE | Create an internal SSL dir
|
||||||
file: path={{ int_ansible_ssl_dir }} state=directory
|
file: path={{ int_ansible_ssl_dir }} state=directory
|
||||||
- name: COPY | Deploy test certificate
|
- name: COPY | Deploy test certificate
|
||||||
@@ -199,14 +177,8 @@
|
|||||||
# --------------------------------
|
# --------------------------------
|
||||||
# Apps
|
# Apps
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
- name: APT | Install web apps
|
- name: INCLUDE | Post_tasks related to OS version
|
||||||
apt: pkg={{ item }} state=present
|
include: "includes/post_{{ ansible_distribution }}.yml"
|
||||||
with_items:
|
|
||||||
- nagios3
|
|
||||||
- backuppc
|
|
||||||
- name: SERVICE | Ensure backuppc is started
|
|
||||||
service: name=backuppc state=started
|
|
||||||
|
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
# Deploy index files
|
# Deploy index files
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user