Skip to content

Commit

Permalink
Merge pull request #599 from cibox/ansible_lamp
Browse files Browse the repository at this point in the history
Ansible 1.9.6. MariaDB, support Ubuntu 16.04
  • Loading branch information
podarok committed Sep 4, 2018
2 parents 7b025fb + 64d0b5e commit 7ad5405
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 19 deletions.
15 changes: 15 additions & 0 deletions cilamp.sh
@@ -0,0 +1,15 @@
#!/bin/sh

. ./requirements.sh

export PYTHONUNBUFFERED=1

# Get server IP from config.yml
IP=$(grep -E '^server_ip:\s.*$' config.yml | cut -d" " -f2)

if [ -z "${IP}" ]; then
echo "Please specify IP address in config.yml"
exit
fi

ansible-playbook -vvvv -i "${IP}", services/cilamp.yml --connection=local --extra-vars "@config.yml"
3 changes: 2 additions & 1 deletion config.yml
@@ -1,4 +1,5 @@
server_ip: 192.168.1.101
server_ip: localhost
connection: local
github_url: https://github.com/NAME/REPOSITORY
# Never put your own user as a bot, because you won't be able to get your PRs tested.
github_username: BOT_NAME
Expand Down
2 changes: 1 addition & 1 deletion contrib/ansible-role-apache/vars/Debian.yml
Expand Up @@ -6,7 +6,7 @@ apache_conf_path: /etc/apache2

__apache_packages:
- apache2
- apache2-mpm-prefork
- apache2-bin
- apache2-utils

apache_ports_configuration_items:
Expand Down
2 changes: 1 addition & 1 deletion contrib/ansible-role-mysql/vars/Debian.yml
Expand Up @@ -2,7 +2,7 @@
mysql_daemon: mysql
mysql_config_file: /etc/mysql/my.cnf
__mysql_packages:
- mysql-common
- mysql-client
- mysql-server
- python-mysqldb
mysql_socket: /var/run/mysqld/mysqld.sock
26 changes: 13 additions & 13 deletions contrib/ansible-role-php/vars/Debian.yml
@@ -1,5 +1,5 @@
---
php_version: 5.6
php_version: 7.1
edge_php_version: ""
__php_packages:
- php{{ php_version }}
Expand All @@ -20,18 +20,18 @@ __php_packages:
- php{{ php_version }}-zip
- libpcre3-dev
- libapache2-mod-php{{ php_version }}
- libapache2-mod-php{{ edge_php_version }}
- php{{ edge_php_version }}-curl
- php{{ edge_php_version }}-yaml
- php{{ edge_php_version }}-mysql
- php{{ edge_php_version }}-gd
- php{{ edge_php_version }}-mbstring
- php{{ edge_php_version }}-pear
- php{{ edge_php_version }}-dev
- php{{ edge_php_version }}-soap
- php{{ edge_php_version }}-xml
- php{{ edge_php_version }}-xdebug
- php{{ edge_php_version }}-zip
#- libapache2-mod-php{{ edge_php_version }}
#- php{{ edge_php_version }}-curl
#- php{{ edge_php_version }}-yaml
#- php{{ edge_php_version }}-mysql
#- php{{ edge_php_version }}-gd
#- php{{ edge_php_version }}-mbstring
#- php{{ edge_php_version }}-pear
#- php{{ edge_php_version }}-dev
#- php{{ edge_php_version }}-soap
#- php{{ edge_php_version }}-xml
#- php{{ edge_php_version }}-xdebug
#- php{{ edge_php_version }}-zip
__php_webserver_daemon: "apache2"

# Vendor-specific configuration paths on Debian/Ubuntu make my brain asplode.
Expand Down
4 changes: 2 additions & 2 deletions core/cibox-env/defaults/main.yml
Expand Up @@ -21,7 +21,7 @@ apt_packages:
- { name: "python-software-properties", status: true }
- { name: "python-dev", status: true }
- { name: "python-setuptools", status: true }
- { name: "python 2.7.9", status: true }
- { name: "python", status: true }
- { name: "python-simplejson", status: true }
- { name: "python-passlib", status: true }
- { name: "python-pip", status: true }
Expand All @@ -45,7 +45,7 @@ pip_packages:
- jinja2
- markupsafe
- MySQL-python
- ansible==1.9.4
- ansible==1.9.6
- virtualenv
- cffi
- cryptography
1 change: 1 addition & 0 deletions core/cibox-env/tasks/main.yml
Expand Up @@ -32,6 +32,7 @@
sudo: yes
apt_repository: repo={{ item }} validate_certs=no
with_items: apt_repos
ignore_errors: true

- name: Update apt
apt: update_cache=yes
Expand Down
Expand Up @@ -36,6 +36,6 @@ echo "Installing required python modules."
pip install paramiko pyyaml jinja2 markupsafe MySQL-python

echo "Installing Ansible."
pip install ansible==1.9.4
pip install ansible==1.9.6

echo 'Finished installing ansible'
8 changes: 8 additions & 0 deletions core/core-lamp/README.md
@@ -0,0 +1,8 @@
# CIBox Core: LAMP

Main Ansible Role that installs LAMP server.

## Requirements

This role should contain only `meta.yml` file with dependencies.

19 changes: 19 additions & 0 deletions core/core-lamp/meta/main.yml
@@ -0,0 +1,19 @@
---
dependencies:
- { role: '../core/cibox-env' }
- { role: '../core/cibox-swap' }
- { role: '../core/facade-apache' }
- { role: '../core/facade-php' }
- { role: '../core/facade-composer' }
- { role: '../core/cibox-drush' }
- { role: '../core/facade-php-pear' }
# - { role: '../core/facade-php-xhprof' }
- { role: '../core/cibox-php-pcntl' }
# - { role: '../core/facade-mysql' }
# - { role: '../core/cibox-jenkins' }
# - { role: '../core/cibox-jetty-solr' }
# - { role: '../core/cibox-sniffers' }
- { role: '../core/facade-ssl-config' }
# - { role: '../core/cibox-behat-selenium2' }
- { role: '../core/cibox-security' }
# - { role: '../core/facade-docker' }
49 changes: 49 additions & 0 deletions services/cilamp.yml
@@ -0,0 +1,49 @@
---
# Do not run this playbook manually! Use 'run.sh'.
- hosts: all
gather_facts: yes
remote_user: root

vars:
drush_composer_version: 8.1.17

drushrc:
drush_usage_log: 1
drush_usage_send: 1

# PHP configs.
php_apc_enabled_in_ini: true

cibox_php_pcntl: no
# Apache config.
cibox_ssl_folder: /etc/apache/ssl
apache_create_vhosts: true
apache_vhosts_filename: "vhosts.conf"
apache_remove_default_vhost: true
apache_default_vhost_filename: "000-default.conf"
apache_vhosts:
- {
servername: "openy",
serveralias: "*.*",
documentroot: "/var/www"
}
apache_vhosts_ssl:
- {
servername: "openy",
serveralias: "*.*",
documentroot: "/var/www",
certificate_file: "{{ cibox_ssl_folder }}/apache.crt",
certificate_key_file: "{{ cibox_ssl_folder }}/apache.key",
}
apache_mods_enabled:
- rewrite.load
- ssl.load

pre_tasks:
- name: Check if the playbook was executed with the runner
fail:
msg: "Please, run this playbook with provision.sh."
when: server_ip is not defined

roles:
- { role: '../core/core-lamp' }

0 comments on commit 7ad5405

Please sign in to comment.