apache2::restart
- Restart apache (important to clear the apc cache)
[:apache][:prefork][:maxrequestworkers]
- Default is instance memory / 80Mb[:apache][:log_filter]
- Array of{variable => regex}
pairs to filter from logs, defaults:{'User-Agent' => 'ELB-HealthChecker'}
{'User-Agent' => 'Amazon Route 53 Health Check Service'}
{'Remote_Addr' => '127\.0\.0\.1'}
files:create
- create files in the app directory from JSON (useful for key files etc)
go-composer
- Install composer
logs::config
- Create config file for CloudWatch logs (Must be done before the daemon is installed)logs::setup
- Install CloudWatch daemonlogs::restart
- Restart CloudWatch daemon
You will need to give your instances permission to access cloud watch logs, this IAM policy on your instance role should work
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:*"
],
"Resource": [
"arn:aws:logs:*:*:*"
]
}
]
}
[:logs][:apache]
- enable sending apache logs to CloudWatch logs[:logs][:symfony]
- enable sending symfony logs (prod and dev) to CloudWatch logs
metrics::setup
- Setup the CloudWatch monitoring - will report disk usage stats
You will need to give your instances permission to access cloud watch, this IAM policy on your instance role should work
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1441183867000",
"Effect": "Allow",
"Action": [
"cloudwatch:PutMetricData"
],
"Resource": [
"*"
]
}
]
}
node:bower
- Run bower install (bower should be installed using the package.json of the project)node:gulp
- Runs gulp in the application dir (default task)node:npm
- Runs npm install in the application dirnode::setup
- Install nodejs/npm (With "legacy" support)
resque::setup
- Installs supervisorresque::config
- Configure workersresque::reload
- Restart supervisor after a config change
symfony::assetic
- assetic:dump --env=prodsymfony::cache
- Clear the Symfony cachesymfony::composer
- Run composer install in application dirsymfony::cron
- Create cron jobs for the Symfony commands in JSONsymfony::ini
- php.ini settingssymfony::logs
- Link Symfony log files into the shared logs foldersymfony::migrate
- Run doctrine migrationssymfony::parameters
- Create the Symfony parameters files from JSONsymfony::permissions
- Set permissions on logs and cache so that apache can write to themsymfony::setup
- Install some common php packages
[:symfony][:ini]
- PHP ini settings to add[:symfony][:console]
- The location of the symfony console, default'app/console'
[:symfony][:writable]
- array of folders that should be writable by the web server, default['app/cache']
{'User-Agent' => 'ELB-HealthChecker'}
{'User-Agent' => 'Amazon Route 53 Health Check Service'}
{'Remote_Addr' => '127\.0\.0\.1'}
The top key should match the application name in Opsworks
parameters
- your Symfony parameters file - If a database is attached in Opsworks then the parametersdatabase_*
will be set automatically.files
- the name and content of any files you need to create, file names are relative to the project directory, or start with a /crons
- the settings for cronjobs that you need to runcommand
- the command and argumentssymfony
- default true - means you are running a symfony command, it will be run inprod
minute
- cron format for the time to run at, default*
hour
- default*
day
- default*
month
- default*
weekday
- default*
writable
- array of directorys that should be writable by apacheresque
- settings for resque - this section must exist for resque to be setup for this app. If this is set then parametersredis_host
,redis_port
andresque_queue
will be set in Symfonyworkers
- number of worker, defaultnode['cpu']['total']
queue
- queue name, defaultdefault
, multiple queues can be separated with a comma, and the order that they're supplied in is the order that they're checked in.bin
- location of resque commands, defaultbin/resque
scheduler
- enable resque_scheduler, defaultfalse
scheduler_bin
- location of scheduler command, defaultbin/resque_scheduler
redis.host
- redis host name, defaultlocalhost
redis.port
- redis port, default6379
app_include
- defaults toapp/bootstrap.php.cache
to make sure annotations are loaded an improve load timeprefix
- set the prefix for all redis keysinterval
- how long, in seconds, to sleep between jobs, default5
interval_scheduler
- how long, in seconds, to sleep between checking for scheduled jobs, default5
blocking
- if true the worker uses BLPOP to wait for jobs, andinterval
is the timeout, defaultfalse
aliases
- a set of aliases that you want to setup in your virtual host
Sample:
{
"my_application": {
"parameters": {
"database_driver": "pdo_mysql",
"database_host": "db.app.com",
"database_name": "db_name",
"database_password": "db_pass",
"database_port": null,
"database_user": "db_user",
"custom_param": "my param",
"locale": "en",
"mailer_encryption": "tls",
"mailer_host": "email-smtp.eu-west-1.amazonaws.com",
"mailer_password": "smtp user secret",
"mailer_transport": "smtp",
"mailer_user": "smtp user key",
"router.request_context.host": "www.app.com",
"router.request_context.scheme": "https",
"secret": "Some symfony secret",
},
"files": {
"app/my secret file.pem": "-----BEGIN CERTIFICATE-----\nABCD...EF==\n-----END CERTIFICATE-----"
},
"crons": [
{
"name": "My regular command",
"command": "app:command",
"minute": "1"
}
],
"writable": [
"web/uploads"
],
"resque": {
"redis": {
"host": "localhost",
"port": 6379
},
"queue": "default",
"scheduler": true,
"prefix": "my_app"
},
"aliases": [{
"url_path": "/url",
"file_path": "/alternative/path"
}]
},
"thumbor": {
"key": "This-Is-A-Secret-Key",
"options": {
"ALLOW_UNSAFE_URL": false
}
},
"symfony": {
"ini": {
"upload_max_filesize": "2M"
}
}
}
If built on the 'php app layer' settings:
go-composer symfony::setup node::setup logs::config logs::setup metrics::setup
symfony::ini files::create symfony::parameters symfony::cache apache2::restart
symfony::logs logs::config logs::restart files::create symfony::parameters symfony::permissions node::npm node::bower node::gulp symfony::composer symfony::assetic symfony::migrate symfony::cache apache2::restart
If built on the 'custom layer' settings:
go-composer symfony::setup resque::setup logs::config logs::setup metrics::setup
php::configure symfony::ini files::create symfony::parameters symfony::cache resque::config resque::reload symfony::cron
deploy::php symfony::logs logs::config logs::restart files::create symfony::parameters symfony::permissions symfony::composer symfony::migrate symfony::cache resque::config resque::reload symfony::cron
deploy::php-undeploy
If built on the 'custom layer' settings:
thumbor::default