Clean and prepare webapps role

This commit is contained in:
Gregory Colpart 2016-12-31 15:06:44 +01:00
parent 5bad738df9
commit 76fd99d283
5 changed files with 21 additions and 86 deletions

View File

@ -1,29 +0,0 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@ -1,38 +1,13 @@
Role Name
=========
# webapps
A brief description of the role goes here.
Install popular webapps
Requirements
------------
## Tasks
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Tasks are extracted in several files, included in `tasks/main.yml` :
Role Variables
--------------
* `wordpress.yml` : wordpress installation
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
## Available variables
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
* `webapp_wordpress_install` : enable wordpress installation

View File

@ -1,2 +1,6 @@
---
# defaults file for webapps
webapps_wordpress_install: False
webapps_wordpress_version: 4.7-branch
webapps_wordpress_upstream: https://github.com/WordPress/WordPress
webapps_wordpress_upstream_default_title: "new blog Evolix SaaS"

View File

@ -1,2 +1,4 @@
---
# tasks file for webapps
- include: wordpress.yml
when: webapps_wordpress_install

View File

@ -1,22 +1,5 @@
---
- name: Installation of wordpress
hosts: '{{ hosts }}'
gather_facts: yes
vars_files:
- './vars/default.yml'
# TODO: create vars file
vars:
service: WordPress
version_service: 4.7-branch
url_service: https://github.com/WordPress/WordPress
site_title: "new blog Evolix SaaS"
tasks:
- name: Init global variables
include: './tasks/var_common.yml'
#- name: Init global variables
# include: './tasks/var_common.yml'
- name: init dir_wpcli
set_fact: dir_wpcli="{{ dir }}/wp-cli"
@ -25,13 +8,13 @@
when: debug_mode
tags: debug_mode
- name: Git clone {{ service }} repository
- name: Git clone Wordpress repository
include: './tasks/git.yml'
vars:
service_git: "{{ service }}"
url_git: "{{ url_service }}"
service_git: WordPress
url_git: "{{ webapps_wordpress_upstream }}"
dest_git: "{{ dir_www }}"
version_git: "{{ version_service }}"
version_git: "{{ webapps_wordpress_version }}"
- name: Creation directory wp-cli
file: >