-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,035 additions
and
348 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ansible-atom | ||
|
||
An ansible role for deploying AtoM. **Not suitable for production yet!** |
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 |
---|---|---|
|
@@ -4,105 +4,89 @@ | |
# Main parameters | ||
# | ||
|
||
atom_user: www-data | ||
atom_group: www-data | ||
atom_path: /usr/share/nginx/atom | ||
atom_repository: | ||
url: https://github.com/artefactual/atom.git | ||
version: qa/2.1.x | ||
|
||
# | ||
# Filesystem permissions | ||
# | ||
|
||
atom_filesystem_permissions: | ||
- path: "{{ atom_path }}/cache" | ||
owner: "{{ atom_user }}" | ||
group: "{{ atom_group }}" | ||
- path: "{{ atom_path }}/log" | ||
owner: "{{ atom_user }}" | ||
group: "{{ atom_group }}" | ||
- path: "{{ atom_path }}/config" | ||
owner: "{{ atom_user }}" | ||
group: "{{ atom_group }}" | ||
- path: "{{ atom_path }}/data" | ||
owner: "{{ atom_user }}" | ||
group: "{{ atom_group }}" | ||
# TODO: required? | ||
# - apps/qubit/config/* | ||
# - uploads/ <-- what if it's a mount point or symlink? | ||
# - downloads/ | ||
atom_environment_type: "production" | ||
atom_user: "www-data" | ||
atom_group: "www-data" | ||
atom_path: "/usr/share/nginx/atom" | ||
atom_repository_url: "https://github.com/artefactual/atom.git" | ||
atom_repository_version: "qa/2.3.x" | ||
|
||
# | ||
# DRMC | ||
# Worker | ||
# | ||
|
||
atom_drmc: no | ||
atom_drmc_path: "{{ atom_path }}/plugins/arDrmcPlugin/frontend" | ||
atom_worker_setup: "yes" | ||
atom_worker_upstart_service_name: "atom-worker" | ||
|
||
# | ||
# Misc | ||
# | ||
|
||
# Populate search index | ||
atom_populate_index: yes | ||
atom_populate_index: "yes" | ||
|
||
# Flush database | ||
atom_flush_data: no | ||
atom_flush_data: "no" | ||
|
||
# Build static assets | ||
atom_build_static_assets: yes | ||
atom_build_static_assets: "yes" | ||
|
||
# Themes (to build) | ||
atom_themes: | ||
- path: "{{ atom_path }}/plugins/arDominionPlugin" | ||
build_cmd: "make" | ||
- path: "{{ atom_path }}/plugins/arArchivesCanadaPlugin" | ||
build_cmd: "make" | ||
|
||
# Plug-ins | ||
atom_plugins: | ||
- "qtSwordPlugin" | ||
|
||
# Default user for tools:purge | ||
atom_user_email: "[email protected]" | ||
atom_user_username: "demo" | ||
atom_user_password: "demo" | ||
atom_title: "AtoM" | ||
atom_description: "Access to Memory" | ||
|
||
# Create extra superusers | ||
# atom_extra_superusers: | ||
# atom_extra_superusers: | ||
# - username: foobar | ||
# password: foobar | ||
# password: foobar | ||
# email: [email protected] | ||
|
||
# Update database settings | ||
# atom_db_settings: | ||
# - k: hits_per_page | ||
# v: 10 | ||
|
||
# Default user for tools:purge | ||
atom_user_email: [email protected] | ||
atom_user_username: demo | ||
atom_user_password: demo | ||
atom_title: AtoM | ||
atom_description: Access to Memory | ||
|
||
# | ||
# factories.yml | ||
# | ||
|
||
atom_factory_user: myUser # e.g. adLdapUser | ||
atom_factory_user_timeout: 1800 | ||
atom_factory_user: "myUser" # e.g. adLdapUser | ||
atom_factory_user_timeout: "1800" | ||
|
||
# | ||
# settings.yml | ||
# | ||
|
||
atom_default_culture: en | ||
atom_default_timezone: America/Vancouver | ||
atom_default_culture: "en" | ||
atom_default_timezone: "America/Vancouver" | ||
|
||
# | ||
# app.yml | ||
# | ||
|
||
atom_app_upload_limit: -1 | ||
atom_app_gearman_job_server: 127.0.0.1:4730 | ||
atom_app_cache_engine: sfMemcacheCache | ||
atom_app_upload_limit: "-1" | ||
atom_app_gearman_job_server: "127.0.0.1:4730" | ||
atom_app_cache_engine: "sfMemcacheCache" | ||
atom_app_cache_engine_options: | ||
storeCacheInfo: yes | ||
prefix: atom | ||
host: 127.0.0.1 | ||
port: 11211 | ||
persistent: yes | ||
storeCacheInfo: "yes" | ||
prefix: "atom" | ||
host: "127.0.0.1" | ||
port: "11211" | ||
persistent: "yes" | ||
|
||
atom_app_read_only: false | ||
# atom_app_google_maps_api_key: | ||
|
@@ -112,55 +96,49 @@ atom_app_read_only: false | |
# config.php | ||
# | ||
|
||
atom_config_db_username: root | ||
atom_config_db_password: root | ||
atom_config_db_hostname: localhost | ||
atom_config_db_port: 3306 | ||
atom_config_db_name: atom | ||
atom_config_db_username: "root" | ||
atom_config_db_password: "root" | ||
atom_config_db_hostname: "localhost" | ||
atom_config_db_port: "3306" | ||
atom_config_db_name: "atom" | ||
|
||
# | ||
# search.yml | ||
# | ||
|
||
atom_es_host: 127.0.0.1 | ||
atom_es_port: 9200 | ||
atom_es_index: atom | ||
atom_es_host: "127.0.0.1" | ||
atom_es_port: "9200" | ||
atom_es_index: "atom" | ||
|
||
# | ||
# php5-fpm pool | ||
# | ||
|
||
atom_pool_path: /etc/php5/fpm/pool.d/atom.conf | ||
atom_pool_path: "/etc/php5/fpm/pool.d/atom.conf" | ||
atom_pool_user: "{{ atom_user }}" | ||
atom_pool_group: "{{ atom_group }}" | ||
atom_pool_listen: /var/run/php5-fpm.atom.sock | ||
atom_pool_listen: "/var/run/php5-fpm.atom.sock" | ||
atom_pool_listen_allowed_clients: "" | ||
atom_pool_listen_owner: www-data # Nginx will use this if it's installed in the same machine | ||
atom_pool_listen_group: www-data # Nginx will use this if it's installed in the same machine | ||
atom_pool_listen_mode: "0600" | ||
atom_pool_pm: dynamic | ||
atom_pool_pm_max_children: 30 | ||
atom_pool_pm_start_servers: 10 | ||
atom_pool_pm_min_spare_servers: 10 | ||
atom_pool_pm_max_spare_servers: 10 | ||
atom_pool_pm_max_requests: 200 | ||
atom_pool_php_memory_limit: 512M | ||
atom_pool_php_max_execution_time: 120 | ||
atom_pool_php_post_max_size: 72M | ||
atom_pool_php_upload_max_filesize: 64M | ||
|
||
# | ||
# php5-fpm pool: environment variables | ||
# | ||
|
||
atom_pool_pm: "dynamic" | ||
atom_pool_pm_max_children: "30" | ||
atom_pool_pm_start_servers: "10" | ||
atom_pool_pm_min_spare_servers: "10" | ||
atom_pool_pm_max_spare_servers: "10" | ||
atom_pool_pm_max_requests: "200" | ||
atom_pool_php_memory_limit: "512M" | ||
atom_pool_php_max_execution_time: "120" | ||
atom_pool_php_post_max_size: "72M" | ||
atom_pool_php_upload_max_filesize: "64M" | ||
atom_pool_php_envs: | ||
ATOM_DEBUG_IP: "127.0.0.1" | ||
ATOM_READ_ONLY: "off" | ||
|
||
|
||
# | ||
# atom worker | ||
# DRMC | ||
# | ||
|
||
atom_upstart_service: "atom-worker" | ||
atom_path: /usr/share/nginx/atom | ||
atom_drmc: "no" | ||
atom_drmc_path: "{{ atom_path }}/plugins/arDrmcPlugin/frontend" |
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,18 +1,20 @@ | ||
--- | ||
- name: Restart php5-fpm | ||
service: name=php5-fpm state=restarted | ||
sudo: yes | ||
|
||
# reload php5-fpm seems to be broken (in trusty at least) | ||
# doing restart instead | ||
- name: Reload php5-fpm | ||
service: name=php5-fpm state=restarted | ||
sudo: yes | ||
- name: "Restart php5-fpm" | ||
service: | ||
name: "php5-fpm" | ||
state: "restarted" | ||
become: "yes" | ||
|
||
- name: Clear sf_cache | ||
shell: "echo help" | ||
# shell: "php symfony cc" | ||
# args: | ||
# chdir: "{{ atom_path }}" | ||
# sudo: yes | ||
# sudo_user: "{{ atom_user }}" | ||
- name: "Reload php5-fpm" | ||
service: | ||
name: "php5-fpm" | ||
state: "reloaded" | ||
become: "yes" | ||
|
||
- name: "Clear sf_cache" | ||
shell: "php symfony cc" | ||
args: | ||
chdir: "{{ atom_path }}" | ||
become: "yes" | ||
become_user: "{{ atom_user }}" |
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,55 +1,92 @@ | ||
--- | ||
- name: Ensure that the necessary directories exist | ||
file: path={{ atom_path }} state=directory owner={{ atom_user }} group={{ atom_group }} | ||
sudo: yes | ||
|
||
- name: "Ensure that the necessary directories exist" | ||
file: | ||
path: "{{ atom_path }}" | ||
state: "directory" | ||
owner: "{{ atom_user }}" | ||
group: "{{ atom_group }}" | ||
become: "yes" | ||
with_items: | ||
- "{{ atom_path }}" | ||
- "{{ atom_path }}/log" | ||
|
||
- name: Cleanup cache/ directory | ||
command: rm -rf {{ atom_path }}/cache/* | ||
sudo: yes # Just in case... | ||
- name: "Cleanup cache/ directory" | ||
command: "rm -rf {{ atom_path }}/cache/*" | ||
become: "yes" | ||
|
||
- name: Relax permissions # ... so we can stop using sudo | ||
command: "chown -R {{ ansible_user_id }} {{ atom_path }}" | ||
tags: assets | ||
sudo: yes | ||
- name: "Pull new code (depth=1 for production)" | ||
git: | ||
update: "yes" | ||
repo: "{{ atom_repository_url }}" | ||
version: "{{ atom_repository_version }}" | ||
dest: "{{ atom_path }}" | ||
accept_hostkey: "yes" | ||
depth: "1" | ||
when: "atom_environment_type == 'production'" | ||
notify: | ||
- "Clear sf_cache" | ||
- "Reload php5-fpm" | ||
become: "yes" | ||
become_user: "{{ atom_user }}" | ||
|
||
- name: Pull new code | ||
git: update=yes | ||
force=yes | ||
repo={{ atom_repository.url }} | ||
version={{ atom_repository.version }} | ||
dest={{ atom_path }} | ||
accept_hostkey=yes | ||
- name: "Pull new code" | ||
git: | ||
update: "yes" | ||
repo: "{{ atom_repository_url }}" | ||
version: "{{ atom_repository_version }}" | ||
dest: "{{ atom_path }}" | ||
accept_hostkey: "yes" | ||
depth: "1" | ||
when: "atom_environment_type == 'development'" | ||
notify: | ||
- Clear sf_cache | ||
- Reload php5-fpm | ||
- "Clear sf_cache" | ||
- "Reload php5-fpm" | ||
become: "yes" | ||
become_user: "{{ atom_user }}" | ||
|
||
- name: Install configuration files | ||
template: src="{{ item.src }}" dest="{{ item.dest }}" | ||
- name: "Install configuration files" | ||
template: | ||
src: "{{ item.src }}" | ||
dest: "{{ item.dest }}" | ||
owner: "{{ atom_user }}" | ||
group: "{{ atom_group }}" | ||
become: "yes" | ||
with_items: | ||
- { src: "config.php.j2", dest: "{{ atom_path }}/config/config.php" } | ||
- { src: "app.yml.j2", dest: "{{ atom_path }}/apps/qubit/config/app.yml" } | ||
- { src: "factories.yml.j2", dest: "{{ atom_path }}/apps/qubit/config/factories.yml" } | ||
- { src: "settings.yml.j2", dest: "{{ atom_path }}/apps/qubit/config/settings.yml" } | ||
- { src: "propel.ini.j2", dest: "{{ atom_path }}/config/propel.ini" } | ||
- { src: "search.yml.j2", dest: "{{ atom_path }}/config/search.yml" } | ||
- src: "atom/config/config.php" | ||
dest: "{{ atom_path }}/config/config.php" | ||
- src: "atom/config/propel.ini" | ||
dest: "{{ atom_path }}/config/propel.ini" | ||
- src: "atom/apps/qubit/config/app.yml" | ||
dest: "{{ atom_path }}/apps/qubit/config/app.yml" | ||
- src: "atom/apps/qubit/config/factories.yml" | ||
dest: "{{ atom_path }}/apps/qubit/config/factories.yml" | ||
- src: "atom/apps/qubit/config/settings.yml" | ||
dest: "{{ atom_path }}/apps/qubit/config/settings.yml" | ||
- src: "atom/apps/qubit/config/search.yml" | ||
dest: "{{ atom_path }}/apps/qubit/config/search.yml" | ||
- src: "atom/apps/qubit/config/gearman.yml" | ||
dest: "{{ atom_path }}/apps/qubit/config/gearman.yml" | ||
notify: | ||
- Clear sf_cache | ||
- Reload php5-fpm | ||
- "Clear sf_cache" | ||
- "Reload php5-fpm" | ||
|
||
- name: Uploads symlink | ||
file: state=link src={{ atom_uploads_symlink }} path="{{ atom_path }}/uploads" force=yes | ||
sudo: yes | ||
when: atom_uploads_symlink is defined | ||
- name: Uploads directory | ||
file: state=directory path="{{ atom_path }}/uploads" owner={{ atom_user }} group={{ atom_group }} | ||
sudo: yes | ||
when: atom_uploads_symlink is undefined | ||
- name: "Uploads symlink" | ||
file: | ||
state: "link" | ||
src: "{{ atom_uploads_symlink }}" | ||
path: "{{ atom_path }}/uploads" | ||
force: "yes" | ||
owner: "{{ atom_user }}" | ||
group: "{{ atom_group }}" | ||
become: "yes" | ||
when: "atom_uploads_symlink is defined" | ||
|
||
- name: Fix permissions | ||
shell: "chown -R {{ item.owner }}:{{ item.group }} {{ item.path }}" | ||
sudo: yes | ||
with_items: atom_filesystem_permissions | ||
ignore_errors: yes | ||
- name: "Uploads directory" | ||
file: | ||
state: "directory" | ||
path: "{{ atom_path }}/uploads" | ||
owner: "{{ atom_user }}" | ||
group: "{{ atom_group }}" | ||
become: "yes" | ||
when: "atom_uploads_symlink is undefined" |
Oops, something went wrong.