Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: all
- sudo: true
- tasks:
- # Apache2
- - name: install apache
- apt: name=apache2 update_cache=yes state=latest
- - name: enabled mod_rewrite
- apache2_module: name=rewrite state=present
- notify:
- - restart apache
- - name: enabled mod_ssl
- apache2_module: name=ssl state=present
- notify:
- - restart apache
- - copy: src=ansible/config/apache2/ssl dest=/etc/apache2
- - copy: src=ansible/config/apache2/default-ssl.conf dest=/etc/apache2/sites-enabled/default-ssl.conf
- notify: restart apache
- - file: path=/var/www/html state=absent
- - file: src=/vagrant dest=/var/www/html owner=vagrant group=vagrant state=link
- # MySQL
- - name: install MySQL
- apt: name={{ item }} state=latest
- with_items:
- - mysql-server
- - mysql-client
- - python-mysqldb
- - name: add mysql user
- mysql_user: name=vagrant
- host={{ item }}
- password=vagrant priv=*.*:ALL,GRANT
- login_user=root
- login_password=
- with_items:
- - '%'
- - localhost
- - mysql_db: name=papas state=present
- # PHP
- - name: install PHP5 packages
- apt: name={{ item }} state=latest
- with_items:
- - php5
- - libapache2-mod-php5
- - php5-cli
- - php5-mysql
- - php-pear
- - php5-mcrypt
- - php5-gd
- - php5-curl
- - php5-xdebug
- - php5-readline
- notify:
- - restart apache
- - copy: src=ansible/config/php.ini dest=/etc/php5/apache2
- - file: path=/etc/php5/cli/php.ini state=absent
- - file: src=/etc/php5/apache2/php.ini dest=/etc/php5/cli/php.ini state=link
- # Redis
- - name: install Redis
- apt: name=redis-server update_cache=yes state=latest
- # Supervisor
- - name: install and configure supervisor
- apt: name=supervisor update_cache=yes state=latest
- - copy: src=ansible/config/supervisor/andromeda.conf dest=/etc/supervisor/cond.d
- - copy: src=ansible/config/supervisor/mail.conf dest=/etc/supervisor/cond.d
- # Mailcatcher
- - name: install Mailcatcher's dependencies
- apt: name={{ item }} update_cache=yes state=latest
- with_items:
- - g++
- - libsqlite3-dev
- - ruby1.9.1-dev
- - name: install Mailcatcher
- gem: name=mailcatcher state=latest
- - name: turn into a service
- copy: src=ansible/config/mailcatcher.conf dest=/etc/init/mailcatcher.conf
- - service: name=mailcatcher state=started enabled=yes
- # Common stuff
- handlers:
- - name: restart apache
- action: service name=apache2 state=restarted
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement