Hi,
I am pretty new to Ansible, and followed Learn Linux TV’s excellent tutorial series.
In which, one of the last things we do is refactor things into different roles/tasks.
I am trying to follow the rvm1-ansible “role” I downloaded using:
ansible-galaxy install rvm.ruby
however, I can see their example code was in “playbook” format, I thought I could just extract what I need and put it in my tasks/main.yml for the targetted web_server role. Like so:
- name: install rvm using the roles function
roles: - { role: rvm.ruby,
tags: ruby,
rvm1_rubies: [‘ruby-2.6.6’],
rvm1_user: ‘webuser’
}
However I get an instant parsing crash when I try to run the playbook.
$ ansible-playbook site.yml
ERROR! unexpected parameter type in action: <class ‘ansible.parsing.yaml.objects.AnsibleSequence’>
The error appears to be in ‘/home/webuser/ansible/homelab/roles/web_servers/tasks/main.yml’: line 46, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: install rvm using the roles function
^ here
I have been trying to find the missing piece on my own through documentation and even reading other ansible-galaxy module install steps to see if I am missing something obvious which I don’t know about.
Thanks
Andy