This repository has been archived by the owner on Feb 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #815 from geerlingguy/roles-in-vm
Include roles with Drupal VM codebase
- Loading branch information
Showing
532 changed files
with
13,039 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Drupal VM - Ansible Provisioning | ||
|
||
Drupal VM uses the Ansible provisioner to build all the software that runs and supplements Drupal sites. | ||
|
||
The Ansible configuration uses a variety of open source community-maintained Ansible Roles that are hosted on Ansible Galaxy, but Drupal VM includes the roles in the codebase for efficiency's sake. | ||
|
||
**You should NOT make any manual changes to the roles in the `roles` directory**, but rather, contribute to the upstream roles corresponding to the role's folder name (e.g. for issues with the `geerlingguy.apache` role, see the [`geerlingguy.apache`](https://galaxy.ansible.com/geerlingguy/apache/) role page on Ansible Galaxy, and the role's [issue tracker on GitHub](https://github.com/geerlingguy/ansible-role-apache/issues)). | ||
|
||
## Adding and Updating Galaxy roles | ||
|
||
From time to time, third party roles need to be added or updated to enable new Drupal VM functionality or fix bugs. To update a role (e.g. `geerlingguy.apache`), find the role's `version` setting inside `requirements.yml`, bump the version to the required or latest version of the role, then run the following command _in the same directory as this README file_: | ||
|
||
$ ansible-galaxy install -r requirements.yml --force | ||
|
||
Then commit the updated `requirements.yml` file and the new and updated files within the `roles` directory in a new PR to the Drupal VM project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[defaults] | ||
roles_path = ./roles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# OS generated files # | ||
###################### | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
Icon? | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# IDE files # | ||
################# | ||
/.settings | ||
/.buildpath | ||
/.project | ||
/nbproject | ||
*.komodoproject | ||
*.kpf | ||
/.idea | ||
|
||
# Other files # | ||
############### | ||
!empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
language: python | ||
python: "2.7" | ||
|
||
env: | ||
- ANSIBLE_VERSION=1.6 | ||
- ANSIBLE_VERSION=1.7 | ||
- ANSIBLE_VERSION=1.8 | ||
|
||
before_install: | ||
- sudo apt-get update -qq | ||
|
||
install: | ||
# Install Ansible. | ||
- pip install ansible==$ANSIBLE_VERSION | ||
|
||
# Add ansible.cfg to pick up roles path. | ||
- "printf '[defaults]\\nroles_path = ../' > ansible.cfg" | ||
|
||
script: | ||
# Check the role/playbook's syntax. | ||
- "ansible-playbook -i tests/inventory tests/test.yml --syntax-check" | ||
|
||
# Run the role/playbook with ansible-playbook. | ||
- "ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo -vvvv" | ||
|
||
# Run the role/playbook again, checking to make sure it's idempotent. | ||
- > | ||
ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo | ||
| grep -q 'changed=0.*failed=0' | ||
&& (echo 'Idempotence test: pass' && exit 0) | ||
|| (echo 'Idempotence test: fail' && exit 1) | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright (c) Alex Knoll | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
## selenium [![Build Status](https://travis-ci.org/arknoll/ansible-role-selenium.svg?branch=master)](https://travis-ci.org/arknoll/ansible-role-selenium) | ||
|
||
Set up selenium and Firefox for running selenium tests. | ||
|
||
#### Requirements | ||
|
||
* `java` | ||
|
||
#### Variables | ||
|
||
* `selenium_install_dir`: [default: `/opt`] Install directory | ||
* `selenium_version`: [default: `2.44.0`] Install version | ||
|
||
## Dependencies | ||
|
||
None | ||
|
||
#### Example | ||
|
||
```yaml | ||
--- | ||
- hosts: all | ||
roles: | ||
- selenium | ||
``` | ||
#### Start/Stop/Restart Selenium | ||
``` | ||
$ service selenium start | ||
$ service selenium stop | ||
$ service selenium restart | ||
``` | ||
|
||
#### License and Author | ||
|
||
Author:: Alex Knoll ([email protected]) | ||
|
||
Copyright:: 2015, Alex Knoll | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
#### Contributing | ||
|
||
We welcome contributed improvements and bug fixes via the usual workflow: | ||
|
||
1. Fork this repository | ||
2. Create your feature branch (`git checkout -b my-new-feature`) | ||
3. Commit your changes (`git commit -am 'Add some feature'`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Create a new pull request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
# defaults file for selenium | ||
selenium_install_dir: /opt | ||
selenium_version: 2.53.0 | ||
selenium_install_firefox: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
# handlers file for selenium | ||
- name: restart selenium | ||
service: name=selenium state=restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{install_date: 'Sat Jul 23 03:17:21 2016', version: 1.3.0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
# meta file for selenium | ||
galaxy_info: | ||
author: Alex Knoll | ||
description: Set up selenium and Firefox for running selenium tests. | ||
license: Apache V2 | ||
min_ansible_version: 1.3 | ||
platforms: | ||
- name: EL | ||
versions: | ||
- 6 | ||
- 7 | ||
- name: Ubuntu | ||
versions: | ||
- all | ||
- name: Debian | ||
versions: | ||
- all | ||
categories: | ||
- web | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
# Tasks file for selenium | ||
- name: create directory | ||
file: "path={{ selenium_install_dir }}/selenium state=directory recurse=yes" | ||
tags: [configuration, selenium, selenium-create-directory] | ||
|
||
- name: download | ||
get_url: "url=http://selenium-release.storage.googleapis.com/{{ selenium_version | regex_replace('\\.[0-9]+$', '') }}/selenium-server-standalone-{{ selenium_version }}.jar dest=/opt/selenium/selenium-server-standalone-{{ selenium_version }}.jar" | ||
tags: [configuration, selenium, selenium-download] | ||
|
||
- name: Install xvfb | ||
apt: name={{item}} | ||
with_items: | ||
- xvfb | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Install browser | ||
apt: name={{item}} | ||
with_items: | ||
- firefox | ||
when: ansible_os_family == 'Debian' and selenium_install_firefox | ||
|
||
- name: Install browser Xvfb | ||
yum: name={{item}} | ||
with_items: | ||
- xorg-x11-server-Xvfb | ||
when: ansible_os_family == 'RedHat' | ||
|
||
- name: Install browser | ||
yum: name={{item}} | ||
with_items: | ||
- firefox | ||
when: ansible_os_family == 'RedHat' and selenium_install_firefox | ||
|
||
|
||
- name: install | ||
template: src=selenium-init-{{ ansible_os_family }}.j2 dest=/etc/init.d/selenium owner=root group=root mode=0755 | ||
tags: [configuration, selenium, selenium-install] | ||
|
||
- name: run | ||
service: name=selenium state=started enabled=yes | ||
tags: [configuration, selenium, selenium-run] |
60 changes: 60 additions & 0 deletions
60
provisioning/roles/arknoll.selenium/templates/selenium-init-Debian.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
|
||
DISPLAY_ID=":1" | ||
RUN_AS=root | ||
|
||
JAVA_BIN=/usr/bin/java | ||
|
||
XVFB_BIN=/usr/bin/xvfb-run | ||
|
||
SELENIUM_DIR={{ selenium_install_dir }}/selenium | ||
SELENIUM_PID_FILE="$SELENIUM_DIR/selenium.pid" | ||
SELENIUM_JAR_FILE="$SELENIUM_DIR/selenium-server-standalone-{{ selenium_version }}.jar" | ||
SELENIUM_LOG_FILE="$SELENIUM_DIR/selenium.log" | ||
SELENIUM_DAEMON_OPTS=" -client -jar $SELENIUM_JAR_FILE -log $SELENIUM_LOG_FILE" | ||
|
||
export DISPLAY="$DISPLAY_ID" | ||
|
||
set -e | ||
|
||
. /lib/lsb/init-functions | ||
|
||
case "$1" in | ||
start) | ||
if status_of_proc -p $SELENIUM_PID_FILE "$SELENIUM_JAR_FILE" $SELENIUM_JAR_FILE > /dev/null; then | ||
log_progress_msg "Service already running" | ||
else | ||
log_daemon_msg "Starting Selenium server" | ||
log_progress_msg "selenium" | ||
start-stop-daemon -c $RUN_AS --start --quiet --background --pidfile $SELENIUM_PID_FILE --make-pidfile --exec $XVFB_BIN $JAVA_BIN -- $SELENIUM_DAEMON_OPTS | ||
fi | ||
;; | ||
|
||
stop) | ||
if status_of_proc -p $SELENIUM_PID_FILE "$SELENIUM_JAR_FILE" $SELENIUM_JAR_FILE > /dev/null; then | ||
log_daemon_msg "Stopping Selenium server" | ||
log_progress_msg "selenium" | ||
start-stop-daemon --stop --pidfile $SELENIUM_PID_FILE | ||
else | ||
log_progress_msg "Service not running" | ||
fi | ||
;; | ||
|
||
restart|force-reload) | ||
$0 stop | ||
sleep 1 | ||
$0 start | ||
;; | ||
|
||
status) | ||
status_of_proc -p $SELENIUM_PID_FILE "$SELENIUM_JAR_FILE" $SELENIUM_JAR_FILE && exit 0 || exit $? | ||
;; | ||
|
||
*) | ||
N=/etc/init.d/selenium | ||
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 | ||
exit 1 | ||
;; | ||
esac |
Oops, something went wrong.