Ansibleの脚本で定義されていないようだ:Wordpressのを設定するための可変Laravelアプリケーション用のサーバを設定するため、次のAnsibleの脚本が正常に動作します
---
- name: Set up a standard Laravel install
hosts: localhost
vars_prompt:
- name: "domain"
prompt: "Domain name"
private: no
- name: "dbname"
prompt: "Database name"
private: no
- name: "dbuser"
prompt: "Database username"
private: no
- name: "dbpassword"
prompt: "Database password"
private: yes
roles:
- create_droplet
- create_domain
- name: Install dependencies
hosts: launched
roles:
- upgrade
- utilities
- users
- nginx-php
- composer
- nginx_firewall
- redis
- postgres
- git
以下同様のものではないインストールします。
どちらのプレイブックはcreate_droplet
とcreate_domain
役割を使用してデジタルオーシャンに新しい液滴を設定し、launched
グループに追加します。二脚本でこのエラーメッセージのように、定義されて表示されていないためしかし、変数が促さ:デバッグ文の
TASK [wordpress : Add user "wordpress", belonging to group "wordpress" and having a home dir of /var/www] ***
fatal: [<IP_ADDRESS_REDACTED>]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'pass' is undefined\n\nThe error appears to have been in '/home/matthew/Projects/ansible-setup/playbooks/roles/wordpress/tasks/main.yml': line 28, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Add user \"wordpress\", belonging to group \"wordpress\" and having a home dir of /var/www\n^here\nWe could be wrong, but this one looks like it might be an issue with\nunbalanced quotes. If starting a value with a quote, make sure the\nline ends with the same set of quotes. For instance this arbitrary\nexample:\n\n foo: \"bad\" \"wolf\"\n\nCould be written as:\n\n foo: '\"bad\" \"wolf\"'\n"}
使用したロールのいずれにおいても、第二脚本に呼び出されることを確認していませんdomain
変数が定義されたように見えます。私はそれがなぜであるかわからない。しかし、液滴を作る部分を取り除いて、既存の液滴と比較すると、うまくいくと思われます。
これはなぜ未定義として表示されますか?これらの変数の範囲とは関係がありますか?