【发布时间】:2019-01-10 12:37:18
【问题描述】:
我正在尝试运行以下 ansible 剧本。但是,我在运行它时遇到错误。
---
- hosts: live
remote_user: root
vars:
destination: /var/www/html/app.mytest.com/releases/{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}{{ ansible_date_time.hour }}{{ ansible_date_time.minute }}{{ ansible_date_time.second }}
tasks:
- git:
repo: 'git@bitbucket:mytest/mytest.git'
dest: "{{ destination }}"
depth: 1
- name: copying .env file to remote host
copy:
src: /root/playbooks/resources/live/.env
dest: "{{ destination }}/"
- name: php artisan migrate
shell: "php {{ destination }}/artisan migrate"
- name: php artisan package:discover
shell: "php {{ destination }}/artisan package:discover"
- name: npm install
shell: "npm install"
- name: npm run dev
shell: "npm run dev"
- name: php artisan queue:restart
shell: "php {{ destination }}/artisan queue:restart"
- name: service supervisord restart
shell: "service supervisord restart"
- name: php artisan queue:flush
shell: "php {{ destination }}/artisan queue:flush"
...
我得到的错误如下:
希望能在解决此语法错误方面提供帮助。
【问题讨论】:
-
尝试引用
vars: destination: "/var/...."的值。违规行通常高于错误消息中报告的行。