请帮助解决以下操作手册的错误。几乎没有其他的剧本和所有用来设置Drupal的东西。
下面的剧本是该设置的一部分,该设置正在抛出错误。
---
- name: Clone Drupal
git: >
repo=http://git.drupal.org/project/drupal.git
dest=/var/www/html/drupal/
update=no
- name: download the code from repository
get_url url:http://ftp.drupal.org/files/projects/drupal-7.37.zip dest: /tmp
- name: Create Dir
command: mkdir -p /var/www/html/
- name: Copy the code from repository
unarchive: src=/tmp/drupal-7.37.zip dest=/var/www/html/ copy=no
- name: Create settings.php
command: cp /var/www/html/drupal/sites/default/default.settings.php /var/www/html/drupal/sites/default/settings.php
- name: services.yml
template: src=services.yml.j2 dest=/var/www/html/drupal/sites/default/service.yml
- name: Update permissions of settings.php
file: path=/var/www/html/drupal/sites/default/settings.php mode=777
- name: Update permissions of service.yml
file: path=/var/www/html/drupal/sites/default/service.yml mode=777
- name: Update permissions of files directory
file: >
path=/var/www/html/drupal/sites/default/files
mode=777
state=directory
recurse=yes错误如下所示:
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to have been in '/opt/playbooks/drupal_set/roles/drupal/tasks/main.yml': line 7, column 4, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
update=no
- name: download the code from repository
^ here如果还没有显示任何其他错误,请帮助更正游戏手册。
发布于 2018-04-04 13:37:06
您缺少了该操作的冒号,这会导致这一点根本不被认为是一个操作,并导致对它的抱怨。
- name: download the code from repository
get_url: url:http://ftp.drupal.org/files/projects/drupal-7.37.zip dest: /tmp
^发布于 2018-04-04 13:37:33
我并不是真正喜欢使用>的“折叠块标量”格式,也不喜欢用key=value语法设置参数,我更喜欢使用与手册中使用的语法相同的语法,您绝对不应该将它们混合在同一个剧本IMHO中。
但是不管你错过了一个冒号:在get_url之后
- name: Clone Drupal
git:
repo: http://git.drupal.org/project/drupal.git
dest: /var/www/html/drupal/
update: no
- name: download the code from repository
get_url:
url: http://ftp.drupal.org/files/projects/drupal-7.37.zip
dest: /tmp发布于 2018-04-04 22:16:21
我认为它解决了这一特定的剧本,并提出了以下其他错误:
failed: [10.42.0.42] (item=[u'php5', u'php5-pdo', u'php5-mysqlnd', u'php5-gd', u'php5-mbstring', u'httpd', u'git', u'libsemanage-python', u'libselinux-python']) => {"changed": false, "item": ["php5", "php5-pdo", "php5-mysqlnd", "php5-gd", "php5-mbstring", "httpd", "git", "libsemanage-python", "libselinux-python"], "msg": "No package matching 'php5' found available, installed or updated", "rc": 126, "results": ["No package matching 'php5' found available, installed or updated"]}对于这个剧本:
---
- name: Install apache
yum: pkg={{ item }} state=present
with_items:
- php5
- php5-pdo
- php5-mysqlnd
- php5-gd
- php5-mbstring
- httpd
- git
- libsemanage-python
- libselinux-python
- name: http service state
service:
name: httpd
state: started
enabled: yeshttps://serverfault.com/questions/905957
复制相似问题