1
railboxを使用して、ぼかしでデプロイできるconfigurationを作成しました。 ただし、次のエラーによってセットアップが中止されます。vagrantを使用してrailsboxを使用してruby/rbenvをデプロイする際にエラーが発生しました
==> myapp: fatal: [127.0.0.1]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'git'\n\nThe error appears to have been in '/ansible/roles/ruby/tasks/rbenv.yml': line 15, 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: Install plugins\n^here\n"}
はrbenv.ymlの内容:
---
- name: Install libffi-dev
apt: name=libffi-dev
- name: Clone rbenv repository to ~/.rbenv
git: repo={{ rbenv_repo }} dest={{ rbenv_path }} version={{ rbenv_version }} accept_hostkey=yes
sudo_user: '{{ user_name }}'
- name: Create rbenv.sh
template: src=rbenv.sh.j2 dest={{ profile_d_path }}/rbenv.sh owner={{ user_name }} group={{ group_name }}
- name: Create plugins directory
file: path={{ rbenv_plugins_path }} state=directory owner={{ user_name }} group={{ group_name }}
- name: Install plugins
git: repo={{ item.git }} dest={{ rbenv_plugins_path }}/{{ item.name }} version={{ item.version }} accept_hostkey=yes
sudo_user: '{{ user_name }}'
with_items: rbenv_plugins
- name: Check if ruby installed
shell: '{{ rbenv_bin }} versions | grep -q {{ rbenv_ruby_version }}'
register: ruby_installed
ignore_errors: yes
sudo_user: '{{ user_name }}'
- name: Install ruby
command: '{{ rbenv_bin }} install {{ rbenv_ruby_version }}'
sudo_user: '{{ user_name }}'
when: ruby_installed|failed
- name: Set global ruby version
command: '{{ rbenv_bin }} global {{ rbenv_ruby_version }}'
sudo_user: '{{ user_name }}'
- name: Rehash rbenv
command: '{{ rbenv_bin }} rehash'
sudo_user: '{{ user_name }}'
YMLファイルの何が問題になっているのですか?あなたがAnsibleの最新バージョンを実行する場合