Search code examples
yamlansibleexuberant-ctags

ctags for ansible project


I am trying to generate tags from my ansible project via ctags. But it is still not picking the right strings. Bellow are params I am working with. What am I missing? After successful run I expect to have ./.tags file which will contain all of the tasks names. I am using ctags 5.8 from Homebrew.

BTW I started here -- http://blog.iany.me/2015/02/ctags-for-ansible/

Command: /usr/local/Cellar/ctags/5.8_1/bin/ctags -f .tags --recurse .

./.ctags

--langdef=ansible
--langmap=ansible:.yml.yaml
--regex-ansible=/^[ \t]*-[ \t]*name:[ \t]*([\w\s]+)\n/\1/i
--languages=+ansible

Example tasks file

---
- name: install docker-py
  pip: name=docker-py version=1.7.2
  become: yes

- name: Install tmux
  yum:
    name:   tmux
    state:  present
    update_cache: yes
  become: yes

I do not insist on ctags. My goal is to have symbols for Atom editor which I could use to quickly jump through my Ansible project.


Solution

  • Reverting to the examples on linked page, made it working. I guess I did the unnecessary changes before I installed ctags from Homebrew