Merge commit '6a684ac9d1537ae2380de32d28137177bb7dbc27' as 'lemp-rhel7/roles/ansible-role-drupal-console'

pull/63/head
Ivan Grynenko 8 years ago
commit 8d837ae6e9
  1. 41
      lemp-rhel7/roles/ansible-role-drupal-console/.travis.yml
  2. 45
      lemp-rhel7/roles/ansible-role-drupal-console/README.md
  3. 4
      lemp-rhel7/roles/ansible-role-drupal-console/defaults/main.yml
  4. 44
      lemp-rhel7/roles/ansible-role-drupal-console/meta/main.yml
  5. 22
      lemp-rhel7/roles/ansible-role-drupal-console/tasks/main.yml
  6. 1
      lemp-rhel7/roles/ansible-role-drupal-console/tests/inventory
  7. 15
      lemp-rhel7/roles/ansible-role-drupal-console/tests/test-self-update.yml
  8. 14
      lemp-rhel7/roles/ansible-role-drupal-console/tests/test.yml

@ -0,0 +1,41 @@
---
sudo: required
language: python
python: "2.7"
env:
- SITE=test.yml
- SITE=test-self-update.yml
before_install:
- sudo apt-get update -qq
install:
# Install Ansible.
- pip install ansible
# Add ansible.cfg to pick up roles path.
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
# Install required dependencies.
- ansible-galaxy install geerlingguy.php
script:
# Check the role/playbook's syntax.
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check"
# Run the role/playbook with ansible-playbook.
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo"
# Run the role/playbook again, checking to make sure it's idempotent.
- >
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Check if Drupal Console is installed and working.
- drupal
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

@ -0,0 +1,45 @@
# Ansible Role: Drupal Console
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-drupal-console.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-drupal-console)
Installs [Drupal Console](http://drupalconsole.com/) on any Linux or UNIX system.
## Requirements
`php` (version 5.4+) should be installed and working.
## Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml`):
drupal_console_path: /usr/local/bin/drupal
The path where Drupal Console will be installed and available to your system. Should be in your user's `$PATH` so you can use Drupal Console by entering `drupal` instead of the full path.
drupal_console_keep_updated: false
By default, this role not update Drupal Console when it is run again. If you'd like always update Drupal Console to the latest version when this role is run, switch this variable to `true`.
drupal_console_config: ~/.console
The path to the Drupal Console configuration file.
## Dependencies
- geerlingguy.php (Installs PHP).
## Example Playbook
- hosts: servers
roles:
- { role: geerlingguy.drupal-console }
After the playbook runs, `drupal` will be placed in `/usr/local/bin/drupal` (this location is configurable), and will be accessible via normal system accounts.
## License
MIT / BSD
## Author Information
This role was created in 2015 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/).

@ -0,0 +1,4 @@
---
drupal_console_path: /usr/local/bin/drupal
drupal_console_keep_updated: false
drupal_console_config: ~/.console

@ -0,0 +1,44 @@
---
dependencies:
- geerlingguy.php
galaxy_info:
author: geerlingguy
description: Drupal Console
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 1.4
platforms:
- name: EL
versions:
- all
- name: GenericUNIX
versions:
- all
- name: Fedora
versions:
- all
- name: opensuse
versions:
- all
- name: GenericBSD
versions:
- all
- name: FreeBSD
versions:
- all
- name: Ubuntu
versions:
- all
- name: SLES
versions:
- all
- name: GenericLinux
versions:
- all
- name: Debian
versions:
- all
galaxy_tags:
- packaging
- web

@ -0,0 +1,22 @@
---
- name: Install Drupal Console.
get_url:
url: https://drupalconsole.com/installer
dest: "{{ drupal_console_path }}"
- name: Ensure Drupal Console is executable.
file:
path: "{{ drupal_console_path }}"
mode: 0755
- name: Run Drupal Console init.
shell: >
php {{ drupal_console_path }} init
creates={{ drupal_console_config }}
- name: Update Drupal Console to latest version (if configured).
shell: >
php {{ drupal_console_path }} self-update
register: drupal_console_update
changed_when: "'console has been updated' in drupal_console_update.stdout"
when: drupal_console_keep_updated

@ -0,0 +1,15 @@
---
- hosts: localhost
remote_user: root
vars:
php_enable_webserver: false
drupal_console_keep_updated: true
pre_tasks:
- name: Add ondrej repository for PHP 5.6.
apt_repository: repo='ppa:ondrej/php5-5.6'
roles:
- geerlingguy.php
- ansible-role-drupal-console

@ -0,0 +1,14 @@
---
- hosts: localhost
remote_user: root
vars:
php_enable_webserver: false
pre_tasks:
- name: Add ondrej repository for PHP 5.6.
apt_repository: repo='ppa:ondrej/php5-5.6'
roles:
- geerlingguy.php
- ansible-role-drupal-console