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.
Fixes #814: Include all required roles in Drupal VM's codebase.
- Loading branch information
1 parent
f4e75b2
commit db7699c
Showing
524 changed files
with
13,018 additions
and
0 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
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 (arknoll@gmail.com) | ||
|
||
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 |
81 changes: 81 additions & 0 deletions
81
provisioning/roles/arknoll.selenium/templates/selenium-init-RedHat.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,81 @@ | ||
#!/bin/bash | ||
# | ||
# Selenium | ||
# | ||
# chkconfig: 345 90 25 | ||
# description: Selenium service | ||
|
||
# Source function library. | ||
. /etc/init.d/functions | ||
|
||
java_bin=/usr/bin/java | ||
|
||
xvfb_bin=/usr/bin/xvfb-run | ||
|
||
selenium_dir={{ selenium_install_dir }}/selenium | ||
selenium_jar_file="$selenium_dir/selenium-server-standalone-{{ selenium_version }}.jar" | ||
user=root | ||
exec="$xvfb_bin $java_bin" | ||
args=" -client -jar $selenium_jar_file" | ||
lockfile="/var/lock/subsys/selenium" | ||
pidfile="$selenium_dir/selenium.pid" | ||
logfile="$selenium_dir/selenium.log" | ||
prog="selenium" | ||
display=":1" | ||
port="4444" | ||
|
||
RETVAL=0 | ||
|
||
start() { | ||
echo -n $"Starting $prog: " | ||
|
||
touch $pidfile | ||
chown $user $pidfile | ||
|
||
touch $logfile | ||
chown $user $logfile | ||
|
||
/bin/su - $user -c "DISPLAY=\"$display\" $exec $args >> $logfile 2>&1 & echo \$! > $pidfile" | ||
|
||
sleep 2 | ||
|
||
pgrep -fl $prog | ||
RETVAL=$? | ||
[ $RETVAL -eq 0 ] && echo_success || echo_failure | ||
|
||
return $RETVAL | ||
} | ||
|
||
stop() { | ||
echo -n $"Stopping $prog: " | ||
killproc -p $pidfile $prog | ||
RETVAL=$? | ||
echo | ||
[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile | ||
return $RETVAL | ||
} | ||
|
||
restart() { | ||
stop | ||
sleep 2 | ||
start | ||
} | ||
|
||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
status) | ||
status -p ${pidfile} ${prog} | ||
RETVAL=$? | ||
;; | ||
restart) | ||
restart | ||
;; | ||
*) | ||
echo $"Usage: $0 {start|stop|restart}" | ||
exit 1 | ||
esac |
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 @@ | ||
localhost |
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,6 @@ | ||
--- | ||
# Test file for selenium | ||
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- ansible-role-selenium |
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 @@ | ||
--- | ||
# vars file for selenium |
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 @@ | ||
[clog] | ||
changelog = "CHANGELOG.md" | ||
repository = "https://github.com/weareinteractive/ansible-newrelic" | ||
from-latest-tag = true |
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,16 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
# Change these settings to your own preference | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
# We recommend you to keep these unchanged | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
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,6 @@ | ||
.* | ||
*~ | ||
!.git* | ||
!.clog.toml | ||
!.travis.yml | ||
!.editorconfig |
Oops, something went wrong.