Hallo ich habe einen Fehler beim Ausführen der folgenden Ansible-Playbook: (Ich versuche, eine LAMP-Stack und WordPress auf meiner virtuellen Maschine zu installieren) Der Fehler scheint, wie es aus der Datenbank kommt.
Sind mysql_db und mysql_user gültige Befehle zum Erstellen von Datenbank und Benutzer?ansible playbook error at -name
Bitte helfen, danke.
---
- hosts: vbox
remote_user: arnold
become: yes
become_method: sudo
vars:
MySQL_root_pass: root_pass
dbase: dbwordpress
user: wp_user
parola: wp_pass
tasks:
- name: Linux update
apt: update_cache=yes
- name: Linux upgrade
apt: upgrade=safe
async: 600
poll: 5
- name: Install apache
apt: pkg=apache2 state=installed
notify:
- start apache
- name: Set MySQL root password before installing
debconf: name='mysql-server' question='mysql-server/root_password' value='{{MySQL_root_pass | quote}}' vtype='password'
- name: Confirm MySQL root password before installing
debconf: name='mysql-server' question='mysql-server/root_password_again' value='{{MySQL_root_pass | quote}}' vtype='password'
- name: Install mysql
apt: name={{ item }} state=installed
with_items:
- mysql-server
- libapache2-mod-auth-mysql
- pkg=php5-mysql
notify:
- start mysql
- name: Install php
apt: name={{ item }} state=installed
with_items:
- php5
- libapache2-mod-php5
- php5-mcrypt
notify:
- restart apache
- name: Create database and user for wordpress
mysql_db: name={{ dbase }} state=present
mysql_user: name={{ user }} password={{ parola }} priv=dbwordpress.*:ALL state=present
notify:
- restart mysql
- name: Install wordpress
command: "{{ item }}"
with_items:
- cd ~
- wget http://wordpress.org/latest.tar.gz
- tar xzvf latest.tar.gz
- cd ~/wordpress
- cp wp-config-sample.php wp-config.php
- name: Config wordpress
lineinfile: dest=~/wordpress/wp-config.php {{ item }}
with_items:
- regexp=^DB_NAME line="define('DB_NAME', '{{ dbase }}');"
- regexp=^DB_USER line="define('DB_USER', '{{ user }}');"
- regexp=^DB_PASSWORD line="define('DB_PASSWORD', '{{ parola }}');"
- name: Copy files to root document
command: "{{ item }}"
with_items:
- rsync -avP ~/wordpress/ /var/www/html/
- cd /var/www/html
- chown -R arnold:arnold *
handlers:
- name: start apache
service: name=apache state=started
- name: start mysql
service: name=mysql state=started
- name: restart mysql
service: name=mysql state=restarted
- name: restart apache
service: name=php state=restarted
und der Fehlercode:
ERROR! conflicting action statements
The error appears to have been in '/home/arnold/Documents/wordpress': line 49, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Create database and user for wordpress
^here
The error appears to have been in '/home/arnold/Documents/wordpress': line 49, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Create database and user for wordpress
^here