Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added lemp setup task (#3)
* Add LEMP installation * Added tests for LEMP * Fix ssh connection issue for newly created droplets * Fix minor issues * Fix travis
- Loading branch information
1 parent
7e73a73
commit 1f19208
Showing
16 changed files
with
263 additions
and
18 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 |
---|---|---|
|
@@ -5,4 +5,5 @@ vendor | |
*.retry | ||
roles/* | ||
!roles/.gitkeep | ||
group_vars/all/secret.yml | ||
group_vars/all/secret.yml | ||
.kitchen |
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,38 @@ | ||
--- | ||
driver: | ||
name: docker | ||
use_sudo: false | ||
|
||
provisioner: | ||
hosts: test-kitchen | ||
name: ansible_playbook | ||
require_chef_for_busser: false | ||
ansible_verbosity: 2 | ||
ansible_verbose: true | ||
requirements_path: requirements.yml | ||
idempotency_test: true | ||
additional_copy_path: tasks | ||
ansible_extra_flags: --skip-tags=mysql | ||
|
||
platforms: | ||
- name: ubuntu-16.04 | ||
driver_config: | ||
image: williamyeh/ansible:ubuntu16.04-onbuild | ||
platform: ubuntu | ||
- name: ubuntu-14.04 | ||
driver_config: | ||
image: williamyeh/ansible:ubuntu14.04-onbuild | ||
platform: ubuntu | ||
|
||
verifier: | ||
name: serverspec | ||
|
||
suites: | ||
- name: lemp | ||
driver: | ||
provision_command: | ||
- export LC_ALL=C | ||
verifier: | ||
default_pattern: true | ||
bundler_path: '/usr/local/bin' | ||
rspec_path: '/usr/local/bin' |
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,77 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
artifactory (2.8.2) | ||
diff-lcs (1.3) | ||
kitchen-ansible (0.48.5) | ||
net-ssh (>= 3) | ||
test-kitchen (~> 1.4) | ||
kitchen-docker (2.6.0) | ||
test-kitchen (>= 1.0.0) | ||
kitchen-vagrant (1.3.2) | ||
test-kitchen (~> 1.4) | ||
kitchen-verifier-serverspec (0.6.11) | ||
net-ssh (>= 3) | ||
test-kitchen (~> 1.4) | ||
mixlib-install (1.2.4) | ||
artifactory | ||
mixlib-shellout | ||
mixlib-versioning | ||
mixlib-shellout (2.3.2) | ||
mixlib-versioning (1.2.2) | ||
multi_json (1.13.1) | ||
net-scp (1.2.1) | ||
net-ssh (>= 2.6.5) | ||
net-ssh (3.2.0) | ||
net-telnet (0.1.1) | ||
rspec (3.7.0) | ||
rspec-core (~> 3.7.0) | ||
rspec-expectations (~> 3.7.0) | ||
rspec-mocks (~> 3.7.0) | ||
rspec-core (3.7.1) | ||
rspec-support (~> 3.7.0) | ||
rspec-expectations (3.7.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.7.0) | ||
rspec-its (1.2.0) | ||
rspec-core (>= 3.0.0) | ||
rspec-expectations (>= 3.0.0) | ||
rspec-mocks (3.7.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.7.0) | ||
rspec-support (3.7.1) | ||
safe_yaml (1.0.4) | ||
serverspec (2.41.3) | ||
multi_json | ||
rspec (~> 3.0) | ||
rspec-its | ||
specinfra (~> 2.72) | ||
sfl (2.3) | ||
specinfra (2.73.3) | ||
net-scp | ||
net-ssh (>= 2.7, < 5.0) | ||
net-telnet | ||
sfl | ||
test-kitchen (1.8.0) | ||
mixlib-install (~> 1.0, >= 1.0.4) | ||
mixlib-shellout (>= 1.2, < 3.0) | ||
net-scp (~> 1.1) | ||
net-ssh (>= 2.9, < 4.0) | ||
safe_yaml (~> 1.0) | ||
thor (~> 0.18) | ||
thor (0.20.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
kitchen-ansible | ||
kitchen-docker | ||
kitchen-vagrant | ||
kitchen-verifier-serverspec | ||
net-ssh | ||
serverspec | ||
test-kitchen (~> 1.8.0) | ||
|
||
BUNDLED WITH | ||
1.16.2 |
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 @@ | ||
--- | ||
nginx_vhosts: | ||
# Example vhost below | ||
- listen: "80" # default: "80" | ||
server_name: "example.com" # default: N/A | ||
root: "/var/www/example.com" # default: N/A | ||
|
||
php_enable_php_fpm: true | ||
php_webserver_daemon: "nginx" | ||
|
||
mysql_users: | ||
- name: mysqluser | ||
password: mysqlabc |
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 |
---|---|---|
@@ -1 +0,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
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,24 @@ | ||
--- | ||
- name: Install Nginx | ||
include_role: | ||
name: nginx | ||
tags: nginx | ||
|
||
- name: Add repository for PHP 7 | ||
apt_repository: repo='ppa:ondrej/php' | ||
tags: php | ||
|
||
- name: Install PHP | ||
include_role: | ||
name: php | ||
tags: php | ||
|
||
- name: Install MySql | ||
include_role: | ||
name: mysql | ||
tags: mysql | ||
|
||
- name: Install PHP MySql package | ||
include_role: | ||
name: php-mysql | ||
tags: [php, mysql] |
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,9 @@ | ||
--- | ||
- hosts: localhost | ||
become: yes | ||
tasks: | ||
- include: tasks/lemp.yml | ||
- name: Start Nginx for Docker | ||
command: nginx | ||
changed_when: false | ||
ignore_errors: 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,19 @@ | ||
require_relative 'spec_helper' | ||
|
||
describe package('nginx') do | ||
it { should be_installed } | ||
end | ||
|
||
describe service('nginx') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
|
||
describe port(80) do | ||
it { should be_listening } | ||
end | ||
|
||
describe file('/etc/nginx/sites-enabled/example.com.conf') do | ||
it { should be_file } | ||
its(:content) { should match /server_name example.com/ } | ||
end |
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 @@ | ||
require_relative 'spec_helper' | ||
|
||
describe package('php7.0-common') do | ||
it { should be_installed } | ||
end |
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 @@ | ||
# Encoding: utf-8 | ||
require 'serverspec' | ||
|
||
set :backend, :exec |