Giter Site home page Giter Site logo

ansible-drupal-settings's Introduction

Drupal Settings

Ansible role to manage Drupal settings.php files.

Features

  • Generate complete settings.php using Ansible variables.
    • Database settings
    • Hash salt
    • Base URL
    • PHP settings
    • Cookie domain
    • Variable overrides
    • Files includes
  • Multi-sites support (with aliasing)

Role Variables

# The path to the sites folder where to create 
drupal_settings_basedir: /var/www/sites

# The sites settings, as a hash of sites
drupal_settings_sites:
  default:
    # Variable overrides (ie. $conf) as a hash
    # Currently only support only array (as nested hash) and string values
    conf: {}
    # Database settings
    # Currently only support only array (as nested hash) and string values
    databases: {}
    # PHP settings (ini_set('{{ key }}', '{{ value }}')) as a hash
    # Currently only support string values
    php_ini: {}
    # Salt for one-time login links and cancel links, form tokens, etc. as a string
    hash_salt: "{{ lookup('password') }}"
    # Base URL as a string (optional)
    base_url: www.example.com
    # Cookie domain as a string (optional)
    cookie_domain: .example.com
    # Whether or not to enable fast 404 as a boolean (optional)
    fast_404: false
    # Site aliases (for sites.php) as a list of strings (optional)
    aliases: []
    # Includes (path to PHP file ton require_once) as a list of strings (optional)
    includes: []

# Default settings for all sites
drupal_settings_default:
  # Variable overrides (ie. $conf) as a hash
  # Currently only support only array (as nested hash) and string values
  conf:
    404_fast_paths_exclude: '/\/(?:styles)\//';
    404_fast_paths: '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
    404_fast_html: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';
  # PHP settings (ini_set('{{ key }}', '{{ value }}')) as a hash
  # Currently only support string values
  php_ini:
    session.gc_probability: 1
    session.gc_divisor: 100
    session.gc_maxlifetime: 200000
    session.cookie_lifetime: 2000000
  # Includes (path to PHP file ton require_once) as a list of strings (optional)
  includes: []

License

Apache v2

Author Information

ansible-drupal-settings's People

Contributors

mathieuhelie avatar pbuyle avatar pierrepaul avatar villette avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

mathieuhelie

ansible-drupal-settings's Issues

file permissions settings.php fail on OSX 10.10

Hi,

Following a vagrant up, i am unable to to run this role because it throws the following error:

TASK: [villette.drupal-settings | Make sure the settings.php files are writable] ***
failed: [default] => (item={'key': 'defa...

msg: Error while touching existing target: [Errno 13] Permission denied: '/var/www/sites/default/settings.php'

FATAL: all hosts have already failed -- aborting

If i go in ssh and change the permission to 666, then provision, it works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.