On 03.03.2017 06:13, [email protected] wrote:
Thank you for helping me I tried that solution but now it is showing
syntax
error on different module
The offending line appears to be:
- name: Update default Apache site
^ here
Can you please check the whole script and tell me all the mistakes I
have
been done in this. It would be very thankful
I did an corrected them all except for sudo: that should be become:, but
sudo will work, you just get a deprecation message.
You have probably introduced new ones, so without the new code it's
difficult to see what's wrong now.
But your code should look like this now.
---
- name: Download WordPress
get_url:
url=https://wordpress.org/latest.tar.gz
dest=/tmp/wordpress.tar.gz
validate_certs=no
- name: Extract WordPress
unarchive:
src=skins/larry/tmp/wordpress.tar.gz
dest=/var/www/
copy=no
become: yes
- name: Update default Apache site
become: 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
become: 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}}');"}
become: yes
--
Kai Stian Olstad
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/d7e13257ed43a5e26d61ce3f7e9fbd4e%40olstad.com.
For more options, visit https://groups.google.com/d/optout.