Skip to content
Snippets Groups Projects
Commit f5b91c37 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#19 Set role header

parent b45306f6
No related branches found
No related tags found
No related merge requests found
---
# file: roles/openphoto/tasks/main.yml
- name: 'OpenPhoto | Install packages'
apt: pkg={{item}} state=installed update_cache=yes
with_items:
- apache2
- build-essential
- curl
- libapache2-mod-php5
- libpcre3-dev
- php-apc
- php-pear
- php5
- php5-curl
- php5-gd
- php5-mcrypt
- php5-mysql
- php5-dev
- php5-imagick
- exiftran
- name: "OpenPhoto Role"
set_fact: role_openphoto_started=true
tags: always
- name: 'OpenPhoto | Enable some required modules'
apache2_module: "{{ item }}"
with_items:
- rewrite
- deflate
- expires
- headers
- block:
#OAuth !?
#pecl install oauth
#mkdir -p /etc/php5/apache2/conf.d/
#echo "extension=oauth.so" >> /etc/php5/apache2/conf.d/oauth.ini
- name: 'OpenPhoto | Install packages'
apt: pkg={{item}} state=installed update_cache=yes
with_items:
- apache2
- build-essential
- curl
- libapache2-mod-php5
- libpcre3-dev
- php-apc
- php-pear
- php5
- php5-curl
- php5-gd
- php5-mcrypt
- php5-mysql
- php5-dev
- php5-imagick
- exiftran
- name: 'OpenPhoto | Checkout OpenPhoto from GitHub'
git: repo=git@github.com:photo/frontend.git
dest=/var/www/openphoto
accept_hostkey=yes
become: false
- name: 'OpenPhoto | Enable some required modules'
apache2_module: "{{ item }}"
with_items:
- rewrite
- deflate
- expires
- headers
- name: 'OpenPhoto | Prepare directories'
file:
dest='{{ item }}'
state=directory
mode=775
with_items:
- '/var/www/openphoto/src/userdata'
- '/var/www/openphoto/src/html/assets/cache'
- '/var/www/openphoto/src/html/photos'
#OAuth !?
#pecl install oauth
#mkdir -p /etc/php5/apache2/conf.d/
#echo "extension=oauth.so" >> /etc/php5/apache2/conf.d/oauth.ini
- name: 'OpenPhoto | Prepare ownership'
file:
path="{{ item }}"
owner="www-data"
group="www-data"
recurse=yes
with_items:
- '/var/www/openphoto/src/userdata'
- '/var/www/openphoto/src/html/assets/cache'
- '/var/www/openphoto/src/html/photos'
- name: 'OpenPhoto | Checkout OpenPhoto from GitHub'
git: repo=git@github.com:photo/frontend.git
dest=/var/www/openphoto
accept_hostkey=yes
become: false
- name: 'OpenPhoto | Configuration file for apache'
template: src=openphoto-vhost.conf
dest=/etc/apache2/sites-available/openphoto
- name: 'OpenPhoto | Prepare directories'
file:
dest='{{ item }}'
state=directory
mode=775
with_items:
- '/var/www/openphoto/src/userdata'
- '/var/www/openphoto/src/html/assets/cache'
- '/var/www/openphoto/src/html/photos'
- name: 'OpenPhoto | Enable the openphoto site for Apache'
command: a2ensite openphoto creates=/etc/apache2/sites-enabled/openphoto
notify:
- 'OpenPhoto | Restart Apache'
- name: 'OpenPhoto | Prepare ownership'
file:
path="{{ item }}"
owner="www-data"
group="www-data"
recurse=yes
with_items:
- '/var/www/openphoto/src/userdata'
- '/var/www/openphoto/src/html/assets/cache'
- '/var/www/openphoto/src/html/photos'
- name: 'OpenPhoto | Configuration file for apache'
template: src=openphoto-vhost.conf
dest=/etc/apache2/sites-available/openphoto
- name: 'OpenPhoto | Enable the openphoto site for Apache'
command: a2ensite openphoto creates=/etc/apache2/sites-enabled/openphoto
notify:
- 'OpenPhoto | Restart Apache'
when: '"openphoto" not in excluded_roles'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment