Advertisement
Guest User

Untitled

a guest
Apr 16th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. ---
  2. - hosts: all
  3. sudo: true
  4. tasks:
  5.  
  6. # Apache2
  7.  
  8. - name: install apache
  9. apt: name=apache2 update_cache=yes state=latest
  10.  
  11. - name: enabled mod_rewrite
  12. apache2_module: name=rewrite state=present
  13. notify:
  14. - restart apache
  15.  
  16. - name: enabled mod_ssl
  17. apache2_module: name=ssl state=present
  18. notify:
  19. - restart apache
  20.  
  21. - copy: src=ansible/config/apache2/ssl dest=/etc/apache2
  22.  
  23. - copy: src=ansible/config/apache2/default-ssl.conf dest=/etc/apache2/sites-enabled/default-ssl.conf
  24. notify: restart apache
  25.  
  26. - file: path=/var/www/html state=absent
  27. - file: src=/vagrant dest=/var/www/html owner=vagrant group=vagrant state=link
  28.  
  29. # MySQL
  30.  
  31. - name: install MySQL
  32. apt: name={{ item }} state=latest
  33. with_items:
  34. - mysql-server
  35. - mysql-client
  36. - python-mysqldb
  37.  
  38. - name: add mysql user
  39. mysql_user: name=vagrant
  40. host={{ item }}
  41. password=vagrant priv=*.*:ALL,GRANT
  42. login_user=root
  43. login_password=
  44. with_items:
  45. - '%'
  46. - localhost
  47.  
  48. - mysql_db: name=papas state=present
  49.  
  50. # PHP
  51.  
  52. - name: install PHP5 packages
  53. apt: name={{ item }} state=latest
  54. with_items:
  55. - php5
  56. - libapache2-mod-php5
  57. - php5-cli
  58. - php5-mysql
  59. - php-pear
  60. - php5-mcrypt
  61. - php5-gd
  62. - php5-curl
  63. - php5-xdebug
  64. - php5-readline
  65. notify:
  66. - restart apache
  67.  
  68. - copy: src=ansible/config/php.ini dest=/etc/php5/apache2
  69. - file: path=/etc/php5/cli/php.ini state=absent
  70. - file: src=/etc/php5/apache2/php.ini dest=/etc/php5/cli/php.ini state=link
  71.  
  72. # Redis
  73. - name: install Redis
  74. apt: name=redis-server update_cache=yes state=latest
  75.  
  76. # Supervisor
  77. - name: install and configure supervisor
  78. apt: name=supervisor update_cache=yes state=latest
  79.  
  80. - copy: src=ansible/config/supervisor/andromeda.conf dest=/etc/supervisor/cond.d
  81. - copy: src=ansible/config/supervisor/mail.conf dest=/etc/supervisor/cond.d
  82.  
  83. # Mailcatcher
  84. - name: install Mailcatcher's dependencies
  85. apt: name={{ item }} update_cache=yes state=latest
  86. with_items:
  87. - g++
  88. - libsqlite3-dev
  89. - ruby1.9.1-dev
  90. - name: install Mailcatcher
  91. gem: name=mailcatcher state=latest
  92.  
  93. - name: turn into a service
  94. copy: src=ansible/config/mailcatcher.conf dest=/etc/init/mailcatcher.conf
  95.  
  96. - service: name=mailcatcher state=started enabled=yes
  97.  
  98. # Common stuff
  99.  
  100. handlers:
  101. - name: restart apache
  102. action: service name=apache2 state=restarted
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement