# vim: set filetype=yaml.ansible : --- - name: Configure ansible_ls when: - __ansible_ls_configured is undefined block: - name: Set ansible_ls install method when: - ansible_ls_install_method is undefined ansible.builtin.set_fact: ansible_ls_install_method: "{% if install_method in ansible_ls_install_methods %}{{ install_method }}{% else %}{{ ansible_ls_install_methods[0] }}{% endif %}" - name: Configure ansible_ls source npm installation when: - ansible_ls_install_method == 'source' ansible.builtin.set_fact: ansible_npm_pkg: name: '@ansible/ansible-language-server' global: true - name: Append ansible-language-server to pkg_npm when: - ansible_ls_install_method == 'source' ansible.builtin.set_fact: pkg_npm: "{{ pkg_npm + [ansible_npm_pkg] }}" - name: Set ansible_ls_configured when: - __ansible_ls_configured is undefined ansible.builtin.set_fact: __ansible_ls_configured: true