Created
April 18, 2014 15:26
-
-
Save akuznecov/11049874 to your computer and use it in GitHub Desktop.
Ansible :: Local project playbook and folder creation
This file contains hidden or 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
--- | |
- name: 'Apply recipes to {{ project | upper }}' | |
hosts: {{ project }} | |
user: adyax | |
sudo: yes | |
vars: | |
project_user: '{{ project }}' | |
project_name: '{{ project }}' | |
webserver_root: '/var/www' | |
webserver_user: 'www-data' | |
instances: | |
- name: 'dev' | |
domains: 'dev.example.com' | |
docroot: "{{ '{{ webserver_root }}' }}/dev" | |
vhost: application | |
cron: present | |
autopull: present | |
auth: present | |
solr: present | |
db: present | |
- name: 'stage' | |
domains: 'stage.example.com stg.example.com' | |
docroot: '{{ '{{ webserver_root }}' }}/stage/current' | |
vhost: application | |
cron: absent | |
autopull: absent | |
auth: present | |
solr: present | |
db: present | |
httpauth_exclusions: | |
- "127.0.0.1" | |
httpauth_varnish: present | |
drupal_cron_task: 'elysia-cron' | |
version_solr: '3.6.2' | |
version_fail2ban: '0.8.11' | |
version_pma: '4.1.11' | |
version_drush: '5.10.0.0' | |
memcached_instances: | |
- port: "11211" | |
memory: "128" | |
- port: "11212" | |
memory: "128" | |
vars_files: | |
- 'projects/{{ '{{ project_name }}' }}/databag.yml' | |
roles: | |
- ansible-bootstrap | |
- adyax-admins | |
- packages-misc | |
- packages-git | |
- packages-pax | |
- common | |
- mail-postfix | |
- security-ssh | |
- security-user | |
- security-sudo | |
- security-iptables | |
- security-fail2ban | |
- cron-drupal | |
- cron-git-autopull | |
- varnish | |
- nginx | |
- nginx-vhost | |
#- nginx-ssl | |
- php | |
- packages-drush | |
- php-fpm | |
- memcached | |
#- memcached-multiple | |
- mysql | |
- mysql-databases | |
#- phpmyadmin | |
#- nginx-pma | |
- packages-java | |
- pax-java | |
- solr | |
- solr-core-conf | |
#- nginx-solr | |
#- ftp | |
#- ftp-ssl | |
#- ftp-custom |
This file contains hidden or 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
- name: 'Local project playbook and folder creation' | |
hosts: 127.0.0.1 | |
connection: local | |
vars_prompt: | |
project: "Please enter project name" | |
tasks: | |
- name: 'Get current_dir' | |
command: pwd | |
register: current_dir | |
- name: 'Prepare project folder' | |
command: cp -r projects/_base_project projects/{{project}} | |
creates=projects/{{project}} | |
- name: 'Prepare playbook' | |
template: src=base-playbook.yml.tpl | |
dest="{{current_dir.stdout}}/project-{{project}}-playbook.yml" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment