Hello, I am trying to deploying wordpress using Ansible for first time. I installed LAMP on my remote server using Ansible but there was a syntax error while I was trying to install wordpress. it shows--
The error appears to have been in '/home/nxadmin/wordpress-ansible/roles/wordpress/tasks/main.yml': line 2, column 36, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: Download WordPress get_url:
^ here
---
- name: Download WordPress get_url:
dest=/tmp/wordpress.tar.gz
validate_certs=no
- name: Extract WordPress unarchive= src=/tmp/wordpress.tar.gz dest=/var/www/ copy=no
sudo: yes
- name: Update default Apache site
sudo: yes
lineinfile:
dest=/etc/apache2/sites-enabled/000-default.conf
regexp="(.)+DocumentRoot /var/www/html"
line="DocumentRoot /var/www/wordpress"
notify:
- restart apache
- name: Copy sample config file
command: mv /var/www/wordpress/wp-config-sample.php /var/www/wordpress/wp-config.php creates=/var/www/wordpress/wp-config.php
sudo: yes
- name: Update WordPress config file
lineinfile:
dest=/var/www/wordpress/wp-config.php
regexp="{{ item.regexp }}"
line="{{ item.line }}"
with_items:
- {'regexp': "define\\('DB_NAME', '(.)+'\\);", 'line': "define('DB_NAME', '{{wp_mysql_db}}');"}
- {'regexp': "define\\('DB_USER', '(.)+'\\);", 'line': "define('DB_USER', '{{wp_mysql_user}}');"}
- {'regexp': "define\\('DB_PASSWORD', '(.)+'\\);", 'line': "define('DB_PASSWORD', '{{wp_mysql_password}}');"}
sudo: yes