Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. ---
  2. - hosts: vbox
  3. remote_user: arnold
  4. become: yes
  5. become_method: sudo
  6. vars:
  7. MySQL_root_pass: root_pass
  8. dbase: dbwordpress
  9. user: wp_user
  10. parola: wp_pass
  11. tasks:
  12. - name: Linux update
  13. apt: update_cache=yes
  14.  
  15. - name: Linux upgrade
  16. apt: upgrade=safe
  17. async: 600
  18. poll: 5
  19.  
  20. - name: Install apache
  21. apt: pkg=apache2 state=installed
  22. notify:
  23. - start apache
  24.  
  25. - name: Set MySQL root password before installing
  26. debconf: name='mysql-server' question='mysql-server/root_password' value='{{MySQL_root_pass | quote}}' vtype='password'
  27.  
  28. - name: Confirm MySQL root password before installing
  29. debconf: name='mysql-server' question='mysql-server/root_password_again' value='{{MySQL_root_pass | quote}}' vtype='password'
  30.  
  31. - name: Install mysql
  32. apt: name={{ item }} state=installed
  33. with_items:
  34. - mysql-server
  35. - libapache2-mod-auth-mysql
  36. - pkg=php5-mysql
  37. notify:
  38. - start mysql
  39.  
  40. - name: Install php
  41. apt: name={{ item }} state=installed
  42. with_items:
  43. - php5
  44. - libapache2-mod-php5
  45. - php5-mcrypt
  46. notify:
  47. - restart apache
  48.  
  49. - name: Create database and user for wordpress
  50. mysql_db: name={{ dbase }} state=present
  51. mysql_user: name={{ user }} password={{ parola }} priv=dbwordpress.*:ALL state=present
  52. notify:
  53. - restart mysql
  54.  
  55. - name: Install wordpress
  56. command: "{{ item }}"
  57. with_items:
  58. - cd ~
  59. - wget http://wordpress.org/latest.tar.gz
  60. - tar xzvf latest.tar.gz
  61. - cd ~/wordpress
  62. - cp wp-config-sample.php wp-config.php
  63. - name: Config wordpress
  64. lineinfile: dest=~/wordpress/wp-config.php {{ item }}
  65. with_items:
  66. - regexp=^DB_NAME line="define('DB_NAME', '{{ dbase }}');"
  67. - regexp=^DB_USER line="define('DB_USER', '{{ user }}');"
  68. - regexp=^DB_PASSWORD line="define('DB_PASSWORD', '{{ parola }}');"
  69.  
  70. - name: Copy files to root document
  71. command: "{{ item }}"
  72. with_items:
  73. - rsync -avP ~/wordpress/ /var/www/html/
  74. - cd /var/www/html
  75. - chown -R arnold:arnold *
  76.  
  77. handlers:
  78. - name: start apache
  79. service: name=apache state=started
  80. - name: start mysql
  81. service: name=mysql state=started
  82. - name: restart mysql
  83. service: name=mysql state=restarted
  84. - name: restart apache
  85. service: name=php state=restarted
  86.  
  87. ERROR! conflicting action statements
  88.  
  89. The error appears to have been in '/home/arnold/Documents/wordpress': line 49, column 7, but may
  90. be elsewhere in the file depending on the exact syntax problem.
  91.  
  92. The offending line appears to be:
  93.  
  94.  
  95. - name: Create database and user for wordpress
  96. ^ here
  97.  
  98.  
  99. The error appears to have been in '/home/arnold/Documents/wordpress': line 49, column 7, but may
  100. be elsewhere in the file depending on the exact syntax problem.
  101.  
  102. The offending line appears to be:
  103.  
  104.  
  105. - name: Create database and user for wordpress
  106. ^ here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement