Skip to content

Commit

Permalink
Merge pull request #121 from lemberg/feature/84-export-all-variables-…
Browse files Browse the repository at this point in the history
…to-config

Export all available variables to the default config
  • Loading branch information
T2L committed Jan 14, 2020
2 parents 0e951fc + 67937f6 commit d437508
Show file tree
Hide file tree
Showing 12 changed files with 262 additions and 109 deletions.
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"license": "GPL-2.0-or-later",
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "vcs",
"url": "https://github.com/T2L/comments.git"
}
],
"require-dev": {
"composer/composer": "^1.9",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
Expand All @@ -25,6 +31,7 @@
"require": {
"php": "^7.2",
"composer-plugin-api": "^1.1",
"consolidation/comments": "dev-master",
"nette/robot-loader": "^3.2",
"symfony/filesystem": "^3.4|^4",
"symfony/yaml": "^3.4|^4"
Expand Down
76 changes: 74 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

165 changes: 153 additions & 12 deletions default.vm-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ vagrant:
# Do not change this value, unless absolutely necessary. Valid use case is
# 32-bit host machine and no support for virtualization of 64-bit guest
# machine.
# Defaults to "Official Ubuntu Server 16.04 LTS (Xenial Xerus)".
# Defaults to 'Official Ubuntu Server 16.04 LTS (Xenial Xerus)'.
# Change this parameter in the local settings file.
box: "ubuntu/xenial64"
box: ubuntu/xenial64
# Box version.
box_version: ">= 0"
box_version: '>= 0'
# Disable automatic update checking be setting this option to false.
# See https://www.vagrantup.com/docs/boxes/versioning.html#automatic-update-checking
box_check_update: false
# Host name. This setting is required. Usually host name matches project name.
hostname: ""
hostname: ''
# Host aliases. Will be added to hosts file alongside <hostname>.test.
host_aliases: []
# Base directory. No trailing slash!
Expand Down Expand Up @@ -53,7 +53,7 @@ vagrant:
# the right place to do it.
virtualbox:
# Machine name. Optional, defaults to Vagrant host name.
name: ""
name: ''
# Number of CPUs. Lower this value if host machine has single/dual core CPU
# and/or no hardware virtualization support.
cpus: 2
Expand All @@ -79,7 +79,7 @@ ansible:
# constraint. This is the default option.
#
# This project has been successfully tested with Ansible 2.6.
version: 2.6.*
version: '2.6.*'

# List of features to install. Some roles depend on each other, be careful.
draft_features:
Expand All @@ -98,9 +98,150 @@ draft_features:
# - solr

# Provisioner (Ansible) configuration.
#
# Any variable that is being used in any Ansible role can be overridden in this
# file.
# For example, in order to install PHP 5.6 instead of default 7.1, specify:
#
# php_version: 5.6

# Role: draft (internal) @ self

ssh_default_directory: '{{ vagrant.base_directory }}'

# Role: oefenweb.swapfile @ v2.0.7

# Set swap file size.
swapfile_size: 2GB

# Role: geerlingguy.mailhog @ 2.1.4

mailhog_install_dir: /opt/mailhog
mailhog_binary_url: 'https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64'
mhsendmail_binary_url: 'https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64'

# Path to daemonize, which is used to launch MailHog via init script.
mailhog_daemonize_bin_path: /usr/sbin/daemonize

# Role: apache2 (internal) @ self

# Web server document root directory
apache2_document_root: docroot

# Log level to use
apache2_log_level: error

# Role: T2L.php @ 1.1.2

# PHP version to install. Possible values: 7.2, 7.3 and 7.4
php_version: '7.1'

# Configure PHP.
php_configuration:
PHP:
error_reporting: E_ALL
error_log: /var/log/draft/php_error.log
display_errors: 'On'
display_startup_errors: 'On'
memory_limit: 256M
output_buffering: 'Off'
upload_max_filesize: 64M
post_max_size: 512M
# Requires MailHog.
sendmail_path: '{{ mailhog_install_dir }}/mhsendmail'

# Configure PHP CLI.
php_cli_configuration:
PHP:
memory_limit: -1

# PHP extensions to install.
php_extensions:
- curl
- gd
- json
- mbstring
- mysql
- sqlite3
- xdebug
- xml
- zip

# Configure PHP extensions.
php_extensions_configuration:
opcache:
opcache.error_log: /var/log/draft/php_opcache_error.log
xdebug:
xdebug.remote_enable: 'On'
xdebug.remote_connect_back: 'On'
xdebug.remote_log: /var/log/draft/php_xdebug_remote.log

# Web server daemon to restart (defaults to Apache 2).
php_web_server_daemon: apache2

# Boolean indicating whether to restart web server or not.
php_restart_web_server: true

# Role: T2L.composer @ 2.0.2

# Composer installation directory.
composer_install_dir: /usr/local/bin

# Composer executable filename.
composer_filename: composer

# Composer version.
composer_version: ''

# Keep Composer up-to-date.
composer_keep_updated: true

# PHP executable name.
composer_php_executable: php

# Role: T2L.java @ 1.1.0

# Open JDK version(s) and package type (jre or jdk).
# Currently supported versions are 6-11 (however not every Java version is
# supported for every Ubuntu version).
java_openjdk_packages:
-
version: 8
type: jre

# Oracle Java version(s).
# Currently supported versions are 8 and 11.
java_oracle_packages: []
# - version: 8

# Java default alternative. Responsible for setting JAVA_HOME as well.
java_default_alternative:
provider: openjdk
version: 8

# Role: T2L.solr @ 2.0.1

# Solr user and group. Defaults to solr:solr.
solr_user: solr
solr_group: '{{ solr_user }}'

# Solr version to install. Minimum supported version is 5.0.0.
solr_version: 6.6.5

# Port Solr should bind to.
solr_port: 8983

# Download Solr here.
solr_download_dir: /tmp

# Solr install directory.
solr_install_dir: /opt

# Solr data directory.
solr_data_dir: /var/solr

# Remove downloaded archive and extracted files.
solr_cleanup_downloads: true

# Remove downloaded GPG keys file and .asc signature file.
solr_cleanup_gpg: true

# Solr cores to configure.
solr_cores:
-
name: drupal
# conf_path: /var/www/project/config/solr
25 changes: 20 additions & 5 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@
password: $6$4kot6S9fS2oGx$gUxPU4xvSSoMku2OHTwPtCDLNCU4OszJMv6616/1DmaLel15k5hNha451ce4tP6hIMd2H.suCv8cb/NNASdPd0
uid: 1000

# Some keys in the 'vagrant' dict are being populated by the Vagrant.
# Molecule uses Docker under the hood. Let's fill the gap.
- name: Add missing variables
set_fact:
vagrant: "{{ vagrant | combine(overrides, recursive=true) }}"
draft_features:
- mailhog
- git_config
- apache2
- mysql
- php
- composer
- java
- solr
vars:
overrides:
hostname: molecule
ip_address: 10.10.10.10

roles:
- ../../provisioning/roles/draft
- ../../provisioning/roles/git_config
Expand All @@ -27,8 +46,4 @@
- T2L.java
- { role: T2L.solr, solr_cleanup_downloads: false, solr_cleanup_gpg: false }
vars_files:
- ../../provisioning/vars/swapfile.yml
- ../../provisioning/vars/php.yml
- ../../provisioning/vars/solr.yml
- ../../provisioning/vars/mailhog.yml
- vm-settings.yml
- ../../default.vm-settings.yml
33 changes: 0 additions & 33 deletions molecule/default/vm-settings.yml

This file was deleted.

6 changes: 0 additions & 6 deletions provisioning/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,3 @@
- { role: T2L.composer, when: "'composer' in draft_features" }
- { role: T2L.java, when: "'java' in draft_features" }
- { role: T2L.solr, when: "'solr' in draft_features" }
vars_files:
- vars/swapfile.yml
- vars/mailhog.yml
- vars/php.yml
- vars/solr.yml
- vars/composer.yml
3 changes: 0 additions & 3 deletions provisioning/vars/composer.yml

This file was deleted.

3 changes: 0 additions & 3 deletions provisioning/vars/mailhog.yml

This file was deleted.

0 comments on commit d437508

Please sign in to comment.